/ /   = = P R E P R O C E S S O R = = 
 
 / /   @ n a m e   " W S H   P l a y l i s t   V i e w e r " 
 
 / /   @ v e r s i o n   " 2 . 1 . 0 " 
 
 / /   @ a u t h o r   " B r 3 t t   a k a   F a l s t a f f   > >   h t t p : / / b r 3 t t . d e v i a n t a r t . c o m _ _ _ m o d e d   b y   T e r r o " 
 
 / /   @ f e a t u r e   " v 1 . 4 " 
 
 / /   @ f e a t u r e   " w a t c h - m e t a d b " 
 
 / /   @ f e a t u r e   " d r a g d r o p " 
 
 / /   = = / P R E P R O C E S S O R = = 
 
 
 
 / /   [ R e q u i r e m e n t s ] 
 
 / /   *   f o o b a r 2 0 0 0   v 1 . 1   o r   b e t t e r     > >   h t t p : / / f o o b a r 2 0 0 0 . o r g 
 
 / /   *   W S H   p a n e l   M o d   v 1 . 5 . 3 . 1   o r   b e t t e r     > >   h t t p : / / c o d e . g o o g l e . c o m / p / f o o - w s h - p a n e l - m o d / d o w n l o a d s / l i s t 
 
 / /   *   O p t i o n a l :   F o n t   u n i   0 5 _ 5 3     > >   h t t p : / / w w w . d a f o n t . c o m / u n i - 0 5 - x . f o n t 
 
 / /         t h i s   f o n t   i s   r e q u i r e d   t o   d i s p l a y   e x t r a   i n f o   i n   g r o u p   h e a d e r   ( c o d e c   +   g e n r e )   a n d   p l a y c o u n t   i n f o 
 
 / /   *   O p t i o n a l :   F o n t   g u i f x   v 2   t r a n s p o r t s     > >   h t t p : / / b l o g . g u i f x . c o m / 2 0 0 9 / 0 4 / 0 2 / g u i f x - v 2 - t r a n s p o r t - f o n t 
 
 / /         t h i s   f o n t   i s   r e q u i r e d   t o   g e t   n i c e   s t a r s   f o r   t h e   r a t i n g   c o l u m n s ,   b u t   i f   n o t   i n s t a l l e d ,   i t   w i l l   w o r k s   w i t h   s t a n d a r d   s t a r   ( * )   c h a r a c t e r 
 
 / /   [ / R e q u i r e m e n t s ] 
 
 
 
 / /   [ I n s t a l l a t i o n ] 
 
 / /   *   i m p o r t / p a s t e   t h i s   j s c r i p t   i n t o   a   W S H   P a n e l   M o d   i n s t a n c e   o f   y o u r   f o o b a r 2 0 0 0   l a y o u t   ( D U I   o r   C U I ) 
 
 / /   [ / I n s t a l l a t i o n ] 
 
 
 
 / /   [ I n f o r m a t i o n s ] 
 
 / /   *   U s e   J s c r i p t 9   e n g i n e   ( i f   s u p p o r t e d   b y   y o u r   s y s t e m )   f o r   b e t t e r   p e r f o r m a n c e s 
 
 / /   *   c h a n g e   c o l o r s   a n d   f o n t s   i n   f o o b a r 2 0 0 0   P r e f e r e n c e s   >   D e f a u l t U I   o r   C o l u m s U I 
 
 / /   *   S o m e   S e t t i n g s   c a n   b e   c h a n g e d   i n   w i n d o w   P r o p e r t i e s   ( P r o p e r t i e s   f r o m   s e t t i n g s   m e n u   - >   t o o l b a r   b u t t o n ) 
 
 / /   *   d o u b l e   c l i c k   o n   t o o l b a r   >   S h o w   N o w   P l a y i n g   i t e m 
 
 / /   *   u s e   k e y b o a r d   t o   s e a r c h   a r t i s t   i n   t h e   p l a y l i s t   ( i n c r e m e n t a l   s e a r c h   f e a t u r e ) 
 
 / /   [ / I n f o r m a t i o n s ] 
 
 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = / /   G e n e r a l   d e c l a r a t i o n s 
 
 S M _ C X V S C R O L L   =   2 ; 
 
 S M _ C Y H S C R O L L   =   3 ; 
 
 D L G C _ W A N T A R R O W S   =   0 x 0 0 0 1 ; 
 
 D L G C _ W A N T A L L K E Y S   =   0 x 0 0 0 4 ; 
 
 / /   } } 
 
 / /   U s e   w i t h   M e n u M a n a g e r ( )   
 
 / /   { { 
 
 M F _ S T R I N G   =   0 x 0 0 0 0 0 0 0 0 ; 
 
 M F _ S E P A R A T O R   =   0 x 0 0 0 0 0 8 0 0 ; 
 
 M F _ G R A Y E D   =   0 x 0 0 0 0 0 0 0 1 ; 
 
 M F _ D I S A B L E D   =   0 x 0 0 0 0 0 0 0 2 ; 
 
 M F _ P O P U P   =   0 x 0 0 0 0 0 0 1 0 ; 
 
 / /   } } 
 
 / /   U s e d   i n   w i n d o w . S e t C u r s o r ( ) 
 
 / /   { { 
 
 I D C _ A R R O W   =   3 2 5 1 2 ; 
 
 I D C _ I B E A M   =   3 2 5 1 3 ; 
 
 I D C _ W A I T   =   3 2 5 1 4 ; 
 
 I D C _ C R O S S   =   3 2 5 1 5 ; 
 
 I D C _ U P A R R O W   =   3 2 5 1 6 ; 
 
 I D C _ S I Z E   =   3 2 6 4 0 ; 
 
 I D C _ I C O N   =   3 2 6 4 1 ; 
 
 I D C _ S I Z E N W S E   =   3 2 6 4 2 ; 
 
 I D C _ S I Z E N E S W   =   3 2 6 4 3 ; 
 
 I D C _ S I Z E W E   =   3 2 6 4 4 ; 
 
 I D C _ S I Z E N S   =   3 2 6 4 5 ; 
 
 I D C _ S I Z E A L L   =   3 2 6 4 6 ; 
 
 I D C _ N O   =   3 2 6 4 8 ; 
 
 I D C _ A P P S T A R T I N G   =   3 2 6 5 0 ; 
 
 I D C _ H A N D   =   3 2 6 4 9 ; 
 
 I D C _ H E L P   =   3 2 6 5 1 ; 
 
 / /   } } 
 
 / /   U s e   w i t h   G d i D r a w T e x t ( )   
 
 / /   { { 
 
 v a r   D T _ L E F T   =   0 x 0 0 0 0 0 0 0 0 ; 
 
 v a r   D T _ R I G H T   =   0 x 0 0 0 0 0 0 0 2 ; 
 
 v a r   D T _ T O P   =   0 x 0 0 0 0 0 0 0 0 ; 
 
 v a r   D T _ C E N T E R   =   0 x 0 0 0 0 0 0 0 1 ; 
 
 v a r   D T _ V C E N T E R   =   0 x 0 0 0 0 0 0 0 4 ; 
 
 v a r   D T _ W O R D B R E A K   =   0 x 0 0 0 0 0 0 1 0 ; 
 
 v a r   D T _ S I N G L E L I N E   =   0 x 0 0 0 0 0 0 2 0 ; 
 
 v a r   D T _ C A L C R E C T   =   0 x 0 0 0 0 0 4 0 0 ; 
 
 v a r   D T _ N O P R E F I X   =   0 x 0 0 0 0 0 8 0 0 ; 
 
 v a r   D T _ E D I T C O N T R O L   =   0 x 0 0 0 0 2 0 0 0 ; 
 
 v a r   D T _ E N D _ E L L I P S I S   =   0 x 0 0 0 0 8 0 0 0 ; 
 
 / /   } } 
 
 / /   K e y b o a r d   F l a g s   &   T o o l s 
 
 / /   { { 
 
 v a r   V K _ B A C K   =   0 x 0 8 ; 
 
 v a r   V K _ R E T U R N   =   0 x 0 D ; 
 
 v a r   V K _ S H I F T   =   0 x 1 0 ; 
 
 v a r   V K _ C O N T R O L   =   0 x 1 1 ; 
 
 v a r   V K _ A L T   =   0 x 1 2 ; 
 
 v a r   V K _ E S C A P E   =   0 x 1 B ; 
 
 v a r   V K _ P G U P   =   0 x 2 1 ; 
 
 v a r   V K _ P G D N   =   0 x 2 2 ; 
 
 v a r   V K _ E N D   =   0 x 2 3 ; 
 
 v a r   V K _ H O M E   =   0 x 2 4 ; 
 
 v a r   V K _ L E F T   =   0 x 2 5 ; 
 
 v a r   V K _ U P   =   0 x 2 6 ; 
 
 v a r   V K _ R I G H T   =   0 x 2 7 ; 
 
 v a r   V K _ D O W N   =   0 x 2 8 ; 
 
 v a r   V K _ I N S E R T   =   0 x 2 D ; 
 
 v a r   V K _ D E L E T E   =   0 x 2 E ; 
 
 v a r   V K _ S P A C E B A R   =   0 x 2 0 ; 
 
 v a r   K M a s k   =   { 
 
         n o n e :   0 , 
 
         c t r l :   1 , 
 
         s h i f t :   2 , 
 
         c t r l s h i f t :   3 , 
 
         c t r l a l t :   4 , 
 
         c t r l a l t s h i f t :   5 , 
 
         a l t :   6 
 
 } ; 
 
 f u n c t i o n   G e t K e y b o a r d M a s k ( )   { 
 
         v a r   c   =   u t i l s . I s K e y P r e s s e d ( V K _ C O N T R O L )   ?   t r u e   :   f a l s e ; 
 
         v a r   a   =   u t i l s . I s K e y P r e s s e d ( V K _ A L T )   ?   t r u e   :   f a l s e ; 
 
         v a r   s   =   u t i l s . I s K e y P r e s s e d ( V K _ S H I F T )   ?   t r u e   :   f a l s e ; 
 
         v a r   r e t   =   K M a s k . n o n e ; 
 
         i f   ( c   & &   ! a   & &   ! s )   r e t   =   K M a s k . c t r l ; 
 
         i f   ( ! c   & &   ! a   & &   s )   r e t   =   K M a s k . s h i f t ; 
 
         i f   ( c   & &   ! a   & &   s )   r e t   =   K M a s k . c t r l s h i f t ; 
 
         i f   ( c   & &   a   & &   ! s )   r e t   =   K M a s k . c t r l a l t ; 
 
         i f   ( c   & &   a   & &   s )   r e t   =   K M a s k . c t r l a l t s h i f t ; 
 
         i f   ( ! c   & &   a   & &   ! s )   r e t   =   K M a s k . a l t ; 
 
         r e t u r n   r e t ; 
 
 } ; 
 
 / /   } } 
 
 / /   { { 
 
 / /   U s e d   i n   w i n d o w . G e t C o l o r C U I ( ) 
 
 C o l o r T y p e C U I   =   { 
 
         t e x t :   0 , 
 
         s e l e c t i o n _ t e x t :   1 , 
 
         i n a c t i v e _ s e l e c t i o n _ t e x t :   2 , 
 
         b a c k g r o u n d :   3 , 
 
         s e l e c t i o n _ b a c k g r o u n d :   4 , 
 
         i n a c t i v e _ s e l e c t i o n _ b a c k g r o u n d :   5 , 
 
         a c t i v e _ i t e m _ f r a m e :   6 
 
 } ; 
 
 / /   U s e d   i n   w i n d o w . G e t F o n t C U I ( ) 
 
 F o n t T y p e C U I   =   { 
 
         i t e m s :   0 , 
 
         l a b e l s :   1 
 
 } ; 
 
 / /   U s e d   i n   w i n d o w . G e t C o l o r D U I ( ) 
 
 C o l o r T y p e D U I   =   { 
 
         t e x t :   0 , 
 
         b a c k g r o u n d :   1 , 
 
         h i g h l i g h t :   2 , 
 
         s e l e c t i o n :   3 
 
 } ; 
 
 / /   U s e d   i n   w i n d o w . G e t F o n t D U I ( ) 
 
 F o n t T y p e D U I   =   { 
 
         d e f a u l t s :   0 , 
 
         t a b s :   1 , 
 
         l i s t s :   2 , 
 
         p l a y l i s t s :   3 , 
 
         s t a t u s b a r :   4 , 
 
         c o n s o l e :   5 
 
 } ; 
 
 / / } } 
 
 / /   { { 
 
 / /   U s e d   i n   g r . D r a w S t r i n g ( ) 
 
 f u n c t i o n   S t r i n g F o r m a t ( )   { 
 
         v a r   h _ a l i g n   =   0 , 
 
         v _ a l i g n   =   0 , 
 
         t r i m m i n g   =   0 , 
 
         f l a g s   =   0 ; 
 
         s w i t c h   ( a r g u m e n t s . l e n g t h )   { 
 
                 c a s e   3 : 
 
                 t r i m m i n g   =   a r g u m e n t s [ 2 ] ; 
 
                 c a s e   2 : 
 
                 v _ a l i g n   =   a r g u m e n t s [ 1 ] ; 
 
                 c a s e   1 : 
 
                 h _ a l i g n   =   a r g u m e n t s [ 0 ] ; 
 
                 b r e a k ; 
 
                 d e f a u l t : 
 
                 r e t u r n   0 ; 
 
         } ; 
 
         r e t u r n   ( ( h _ a l i g n   < <   2 8 )   |   ( v _ a l i g n   < <   2 4 )   |   ( t r i m m i n g   < <   2 0 )   |   f l a g s ) ; 
 
 } ; 
 
 S t r i n g A l i g n m e n t   =   { 
 
         N e a r :   0 , 
 
         C e n t r e :   1 , 
 
         F a r :   2 
 
 } ; 
 
 v a r   l t _ s t r i n g f o r m a t   =   S t r i n g F o r m a t ( S t r i n g A l i g n m e n t . N e a r ,   S t r i n g A l i g n m e n t . N e a r ) ; 
 
 v a r   c t _ s t r i n g f o r m a t   =   S t r i n g F o r m a t ( S t r i n g A l i g n m e n t . C e n t r e ,   S t r i n g A l i g n m e n t . N e a r ) ; 
 
 v a r   r t _ s t r i n g f o r m a t   =   S t r i n g F o r m a t ( S t r i n g A l i g n m e n t . F a r ,   S t r i n g A l i g n m e n t . N e a r ) ; 
 
 v a r   l c _ s t r i n g f o r m a t   =   S t r i n g F o r m a t ( S t r i n g A l i g n m e n t . N e a r ,   S t r i n g A l i g n m e n t . C e n t r e ) ; 
 
 v a r   c c _ s t r i n g f o r m a t   =   S t r i n g F o r m a t ( S t r i n g A l i g n m e n t . C e n t r e ,   S t r i n g A l i g n m e n t . C e n t r e ) ; 
 
 v a r   r c _ s t r i n g f o r m a t   =   S t r i n g F o r m a t ( S t r i n g A l i g n m e n t . F a r ,   S t r i n g A l i g n m e n t . C e n t r e ) ; 
 
 v a r   l b _ s t r i n g f o r m a t   =   S t r i n g F o r m a t ( S t r i n g A l i g n m e n t . N e a r ,   S t r i n g A l i g n m e n t . F a r ) ; 
 
 v a r   c b _ s t r i n g f o r m a t   =   S t r i n g F o r m a t ( S t r i n g A l i g n m e n t . C e n t r e ,   S t r i n g A l i g n m e n t . F a r ) ; 
 
 v a r   r b _ s t r i n g f o r m a t   =   S t r i n g F o r m a t ( S t r i n g A l i g n m e n t . F a r ,   S t r i n g A l i g n m e n t . F a r ) ; 
 
 / / } } 
 
 / /   { { 
 
 / /   U s e d   i n   u t i l s . G e t A l b u m A r t ( ) 
 
 A l b u m A r t I d   =   { 
 
 	 f r o n t :   0 , 
 
 	 b a c k :   1 , 
 
 	 d i s c :   2 , 
 
 	 i c o n :   3 , 
 
 	 a r t i s t :   4 
 
 } ; 
 
 / / } } 
 
 / /   { { 
 
 / /   U s e d   e v e r y w h e r e ! 
 
 f u n c t i o n   R G B ( r ,   g ,   b )   { 
 
         r e t u r n   ( 0 x f f 0 0 0 0 0 0   |   ( r   < <   1 6 )   |   ( g   < <   8 )   |   ( b ) ) ; 
 
 } ; 
 
 f u n c t i o n   R G B A ( r ,   g ,   b ,   a )   { 
 
         r e t u r n   ( ( a   < <   2 4 )   |   ( r   < <   1 6 )   |   ( g   < <   8 )   |   ( b ) ) ; 
 
 } ; 
 
 f u n c t i o n   g e t A l p h a ( c o l o r )   { 
 
         r e t u r n   ( ( c o l o r   > >   2 4 )   &   0 x f f ) ; 
 
 } 
 
 
 
 f u n c t i o n   g e t R e d ( c o l o r )   { 
 
         r e t u r n   ( ( c o l o r   > >   1 6 )   &   0 x f f ) ; 
 
 } 
 
 
 
 f u n c t i o n   g e t G r e e n ( c o l o r )   { 
 
         r e t u r n   ( ( c o l o r   > >   8 )   &   0 x f f ) ; 
 
 } 
 
 
 
 f u n c t i o n   g e t B l u e ( c o l o r )   { 
 
         r e t u r n   ( c o l o r   &   0 x f f ) ; 
 
 } 
 
 f u n c t i o n   n u m ( s t r g ,   n b )   { 
 
         v a r   i ; 
 
         v a r   s t r   =   s t r g . t o S t r i n g ( ) ; 
 
         v a r   k   =   n b   -   s t r . l e n g t h ; 
 
         i f   ( k   >   0 )   { 
 
                 f o r   ( i = 0 ; i < k ; i + + )   { 
 
                         s t r   =   " 0 "   +   s t r ; 
 
                 } ; 
 
         } ; 
 
         r e t u r n   s t r . t o S t r i n g ( ) ; 
 
 } ; 
 
 f u n c t i o n   C u s t o m C o l o r ( c o l o r ) { 
 
       t e m p c   =   c o l o r . s p l i t ( " - " ) ; 
 
       r e t u r n   ( 0 x f f 0 0 0 0 0 0   |   ( t e m p c [ 0 ] < < 1 6 )   |   ( t e m p c [ 1 ] < < 8 )   |   ( t e m p c [ 2 ] ) ) ; 
 
 } 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 / /   c o l o r   v a r s 
 
 v a r   g _ c o l o r _ n o r m a l _ b g   =   0 ; 
 
 v a r   g _ c o l o r _ s e l e c t e d _ b g   =   0 ; 
 
 v a r   g _ c o l o r _ n o r m a l _ t x t   =   0 ; 
 
 v a r   g _ c o l o r _ s e l e c t e d _ t x t   =   0 ; 
 
 v a r   g _ c o l o r _ h i g h l i g h t   =   0 ; 
 
 v a r   g _ s y s c o l o r _ w i n d o w _ b g   =   0 ; 
 
 v a r   g _ s y s c o l o r _ h i g h l i g h t   =   0 ; 
 
 v a r   g _ s y s c o l o r _ b u t t o n _ b g   =   0 ; 
 
 v a r   g _ s y s c o l o r _ b u t t o n _ t x t   =   0 ; 
 
 
 
 v a r   o v e r l a y _ c o l o r   =   R G B A ( 0 , 0 , 0 , 5 0 ) ; 
 
 v a r   b x   =   0 ; 
 
 v a r   b y   =   0 ; 
 
 v a r   b w   =   w w ; 
 
 v a r   b h   =   w h ; 
 
 
 
 
 
 v a r   b r w   =   n u l l ; 
 
 v a r   w p p _ i m g _ i n f o   =   { o r i e n t :   0 ,   c u t :   0 ,   c u t _ o f f s e t :   0 ,   r a t i o :   0 ,   x :   0 ,   y :   0 ,   w :   0 ,   h :   0 } ; 
 
 v a r   g _ w a l l p a p e r I m g   =   n u l l ; 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 p p t   =   { 
 
         
 
         s h o w w a l l p a p e r :   w i n d o w . G e t P r o p e r t y ( " _ D I S P L A Y :   S h o w   W a l l p a p e r " ,   t r u e ) , 
 
         w a l l p a p e r b l u r r e d :   w i n d o w . G e t P r o p e r t y ( " _ D I S P L A Y :   W a l l p a p e r   B l u r r e d " ,   t r u e ) , 
 
         w a l l p a p e r b l u r v a l u e :   w i n d o w . G e t P r o p e r t y ( " _ D I S P L A Y :   W a l l p a p e r   B l u r   v a l u e " ,   2 . 0 0 ) / 1 . 6 , 
 
         w a l l p a p e r m o d e :   w i n d o w . G e t P r o p e r t y ( " _ D I S P L A Y :   W a l l p a p e r   M o d e " ,   f a l s e ) , 
 
         w a l l p a p e r p a t h :   w i n d o w . G e t P r o p e r t y ( " _ D I S P L A Y :   D e f a u l t   W a l l p a p e r   P a t h " ,   " . \ \ w s h _ b r 3 t t \ \ j s p l a y l i s t \ \ i m a g e s \ \ d e f a u l t . j p g " ) , 
 
         w a l l p a p e r a l p h a :   w i n d o w . G e t P r o p e r t y ( " _ D I S P L A Y :   W a l l p a p e r   A l p h a " ,   1 5 0 ) , 
 
         w a l l p a p e r o v e r l a y a l p h a :   w i n d o w . G e t P r o p e r t y ( " _ D I S P L A Y :   W a l l p a p e r   O v e r l a y   A l p h a " ,   5 0 ) , 
 
         t o u c h _ o n :   w i n d o w . G e t P r o p e r t y ( " _ S Y S T E M :   T o u c h   S c r o l l   O N | O F F " ,   f a l s e ) , 
 
         t o u c h _ s e n s :   w i n d o w . G e t P r o p e r t y ( " _ S Y S T E M :   T o u c h   S e n s i t i v i t y _ ( d e f a u l t   2 5 ) " ,   2 5 ) , 
 
         t o u c h _ s c r o l l _ s t e p :   w i n d o w . G e t P r o p e r t y ( " _ S Y S T E M :   T o u c h ( M o u s e )   S c r o l l   s t e p " , 1 ) , 
 
         s c r o l l _ z o n e _ c o n t r o l :   w i n d o w . G e t P r o p e r t y ( " _ S Y S T E M :   F a s t   S c r o l l   Z o n e   W i d t h " , 3 0 0 ) , 
 
         s c r o l l _ z o n e _ s e n s i t i v i t y :   w i n d o w . G e t P r o p e r t y ( " _ S Y S T E M :   F a s t   S c r o l l   Z o n e   S e n s i t i v i t y " , 3 ) , 
 
         b a c k g r o u n d _ c o l o r :   w i n d o w . G e t P r o p e r t y ( " _ C O L O R :   B a c k g r o u n d   F i l l   C o l o r " , " 1 5 - 1 5 - 1 5 " ) , 
 
         p r o g r e s s _ b a r _ a l p h a :   w i n d o w . G e t P r o p e r t y ( " _ C O L O R :   P r o g r e s s   b a r   A L P H A " , 6 5 ) , 
 
         p r o g r e s s _ b a r _ c o l o r :   w i n d o w . G e t P r o p e r t y ( " _ C O L O R :   P r o g r e s s   b a r   C o l o r " , " 8 5 - 2 5 5 - 0 " ) , 
 
         p r o g r e s s _ b a r _ c o l o r _ c u s t o m :   w i n d o w . G e t P r o p e r t y ( " _ C O L O R :   P r o g r e s s   b a r   C u s t o m   C o l o r " ,   t r u e ) , 
 
         i t e m _ s e l e c t _ a l p h a :   w i n d o w . G e t P r o p e r t y ( " _ C O L O R :   I t e m   S e l e c t   A L P H A " , 5 5 ) , 
 
         g _ t e x t c o l o r _ s e l _ i t e m :   w i n d o w . G e t P r o p e r t y ( " _ C O L O R :   I t e m   S e l e c t   C o l o r " , " 2 0 0 - 2 0 0 - 2 1 0 " ) , 
 
         p l a y _ i c o n _ c o l o r :   w i n d o w . G e t P r o p e r t y ( " _ C O L O R :   P l a y   I c o n   C o l o r " , " 8 5 - 2 5 5 - 0 " ) , 
 
         p l a y _ i c o n _ c o l o r _ a l p h a :   w i n d o w . G e t P r o p e r t y ( " _ C O L O R :   P l a y   I c o n   C o l o r   A L P H A " , 2 5 0 ) , 
 
         d a t e _ c o l o r :   w i n d o w . G e t P r o p e r t y ( " _ C O L O R :   D a t e   C o l o r " , " 2 0 0 - 2 0 0 - 2 1 0 " ) , 
 
         d a t e _ c o l o r _ a l p h a :   w i n d o w . G e t P r o p e r t y ( " _ C O L O R :   D a t e   C o l o r   A L P H A " , 5 5 ) , 
 
         t r _ n u m b e r _ g r a d _ c o l o r _ 1 :   w i n d o w . G e t P r o p e r t y ( " _ C O L O R :   T r a c k   N u m b e r   G r a d i e n t   C o l o r   1 " , " 3 0 - 3 0 - 3 5 " ) , 
 
         t r _ n u m b e r _ g r a d _ c o l o r _ 2 :   w i n d o w . G e t P r o p e r t y ( " _ C O L O R :   T r a c k   N u m b e r   G r a d i e n t   C o l o r   2 " , " 2 0 0 - 2 0 0 - 2 1 0 " ) , 
 
         t r _ n u m b e r _ g r a d _ c o l o r _ 1 _ a l p h a :   w i n d o w . G e t P r o p e r t y ( " _ C O L O R :   T r a c k   N u m b e r   G r a d i e n t   C o l o r   1   A L P H A " , 1 5 ) , 
 
         t r _ n u m b e r _ g r a d _ c o l o r _ 2 _ a l p h a :   w i n d o w . G e t P r o p e r t y ( " _ C O L O R :   T r a c k   N u m b e r   G r a d i e n t   C o l o r   2   A L P H A " , 1 5 ) , 
 
         t r _ n u m b e r _ r e c t _ c o l o r :   w i n d o w . G e t P r o p e r t y ( " _ C O L O R :   T r a c k   N u m b e r   R e c t   C o l o r " , " 2 0 0 - 2 0 0 - 2 1 0 " ) , 
 
         t r _ n u m b e r _ r e c t _ c o l o r _ a l p h a :   w i n d o w . G e t P r o p e r t y ( " _ C O L O R :   T r a c k   N u m b e r   R e c t   C o l o r   A L P H A " , 1 0 ) , 
 
         t r _ n u m b e r _ t e x t _ c o l o r _ 1 :   w i n d o w . G e t P r o p e r t y ( " _ C O L O R :   T r a c k   N u m b e r   T e x t   C o l o r   1 " , " 2 5 5 - 2 5 5 - 2 5 5 " ) , 
 
         t r _ n u m b e r _ t e x t _ c o l o r _ 2 :   w i n d o w . G e t P r o p e r t y ( " _ C O L O R :   T r a c k   N u m b e r   T e x t   C o l o r   2 " , " 1 0 0 - 1 0 0 - 1 1 0 " ) , 
 
         t o o l b a r _ c o l o r :   w i n d o w . G e t P r o p e r t y ( " _ C O L O R :   T o o l b a r   C o l o r " , " 0 - 0 - 0 " ) , 
 
         t o o l b a r _ r e c t _ c o l o r :   w i n d o w . G e t P r o p e r t y ( " _ C O L O R :   T o o l b a r   R e c t   C o l o r " , " 2 5 5 - 2 5 5 - 2 5 5 " ) , 
 
         t o o l b a r _ c o l o r _ a l p h a :   w i n d o w . G e t P r o p e r t y ( " _ C O L O R :   T o o l b a r   C o l o r   A L P H A " , 1 9 0 ) , 
 
         t o o l b a r _ r e c t _ c o l o r _ a l p h a :   w i n d o w . G e t P r o p e r t y ( " _ C O L O R :   T o o l b a r   R e c t   C o l o r   A L P H A " , 1 4 0 ) , 
 
         e x t r a _ g r o u p _ i n f o s _ c o l o r :   w i n d o w . G e t P r o p e r t y ( " _ C O L O R :   E x t r a   g r o u p   i n f o s   C o l o r " , " 2 0 0 - 2 0 0 - 2 1 0 " ) , 
 
         e x t r a _ g r o u p _ i n f o s _ c o l o r _ a l p h a :   w i n d o w . G e t P r o p e r t y ( " _ C O L O R :   E x t r a   g r o u p   i n f o s   C o l o r   A L P H A " , 1 4 0 ) , 
 
         f o n t _ n a m e :   w i n d o w . G e t P r o p e r t y ( " _ P R O P E R T Y :   F o n t   n a m e " , " S e g o e   U I " ) , 
 
         f o n t _ s i z e :   w i n d o w . G e t P r o p e r t y ( " _ P R O P E R T Y :   F o n t   s i z e " , 2 0 ) , 
 
         f o n t _ m o o d _ s i z e :   w i n d o w . G e t P r o p e r t y ( " _ P R O P E R T Y :   F o n t   M o o d   s i z e " , 2 0 ) , 
 
         f o n t _ h e a d e r s _ n a m e :   w i n d o w . G e t P r o p e r t y ( " _ P R O P E R T Y :   F o n t   H e a d e r s   n a m e " , " S e g o e   U I " ) , 
 
         f o n t _ h e a d e r s _ s i z e :   w i n d o w . G e t P r o p e r t y ( " _ P R O P E R T Y :   F o n t   H e a d e r s   s i z e " , 3 0 ) , 
 
         f o n t _ m i n i _ n a m e :   w i n d o w . G e t P r o p e r t y ( " _ P R O P E R T Y :   F o n t   M i n i   n a m e " , " S e g o e   U I " ) , 
 
         f o n t _ m i n i _ s i z e :   w i n d o w . G e t P r o p e r t y ( " _ P R O P E R T Y :   F o n t   M i n i   s i z e " , 1 5 ) , 
 
         f o n t _ d a t e _ n a m e :   w i n d o w . G e t P r o p e r t y ( " _ P R O P E R T Y :   F o n t   D a t e   n a m e " , " S e g o e   U I " ) , 
 
         f o n t _ d a t e _ s i z e :   w i n d o w . G e t P r o p e r t y ( " _ P R O P E R T Y :   F o n t   D a t e   s i z e " , 2 5 ) , 
 
         f o n t _ d a t e _ s t y l e :   w i n d o w . G e t P r o p e r t y ( " _ P R O P E R T Y :   F o n t   D a t e   s t y l e " , 0 ) , 
 
         i n c s e a r c h _ f o n t _ s i z e :   w i n d o w . G e t P r o p e r t y ( " _ P R O P E R T Y :   F o n t   I n c r e m e n t a l   S e a r c h   s i z e " , 2 5 ) , 
 
         q _ s e a r c h _ t i m e r :   w i n d o w . G e t P r o p e r t y ( " _ S Y S T E M :   I n c r e m e n t a l   S e a r c h   t i m e r " , 3 ) * 1 0 0 0 
 
         
 
 } ; 
 
 
 
 p p t . b a c k g r o u n d _ c o l o r   =   C u s t o m C o l o r ( p p t . b a c k g r o u n d _ c o l o r ) ; 
 
 p p t . g _ t e x t c o l o r _ s e l _ i t e m   =   C u s t o m C o l o r ( p p t . g _ t e x t c o l o r _ s e l _ i t e m ) ; 
 
 p p t . p r o g r e s s _ b a r _ c o l o r   =   C u s t o m C o l o r ( p p t . p r o g r e s s _ b a r _ c o l o r ) ; 
 
 p p t . p l a y _ i c o n _ c o l o r   =   C u s t o m C o l o r ( p p t . p l a y _ i c o n _ c o l o r ) ; 
 
 p p t . d a t e _ c o l o r   =   C u s t o m C o l o r ( p p t . d a t e _ c o l o r ) ; 
 
 p p t . t r _ n u m b e r _ g r a d _ c o l o r _ 1   =   C u s t o m C o l o r ( p p t . t r _ n u m b e r _ g r a d _ c o l o r _ 1 ) ; 
 
 p p t . t r _ n u m b e r _ g r a d _ c o l o r _ 2   =   C u s t o m C o l o r ( p p t . t r _ n u m b e r _ g r a d _ c o l o r _ 2 ) ; 
 
 p p t . t r _ n u m b e r _ r e c t _ c o l o r   =   C u s t o m C o l o r ( p p t . t r _ n u m b e r _ r e c t _ c o l o r ) ; 
 
 p p t . t r _ n u m b e r _ t e x t _ c o l o r _ 1   =   C u s t o m C o l o r ( p p t . t r _ n u m b e r _ t e x t _ c o l o r _ 1 ) ; 
 
 p p t . t r _ n u m b e r _ t e x t _ c o l o r _ 2   =   C u s t o m C o l o r ( p p t . t r _ n u m b e r _ t e x t _ c o l o r _ 2 ) ; 
 
 p p t . t o o l b a r _ c o l o r   =   C u s t o m C o l o r ( p p t . t o o l b a r _ c o l o r ) ; 
 
 p p t . t o o l b a r _ r e c t _ c o l o r   =   C u s t o m C o l o r ( p p t . t o o l b a r _ r e c t _ c o l o r ) ; 
 
 p p t . e x t r a _ g r o u p _ i n f o s _ c o l o r   =   C u s t o m C o l o r ( p p t . e x t r a _ g r o u p _ i n f o s _ c o l o r ) ; 
 
 
 
 v a r   b r w   =   n u l l ; 
 
 v a r   w p p _ i m g _ i n f o   =   { o r i e n t :   0 ,   c u t :   0 ,   c u t _ o f f s e t :   0 ,   r a t i o :   0 ,   x :   0 ,   y :   0 ,   w :   0 ,   h :   0 } ; 
 
 v a r   g _ w a l l p a p e r I m g   =   n u l l ; 
 
 v a r   t o u c h _ o n ; 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 / / T i m e   f o r m a t t i n g   s e c o n d e s   - >   0 : 0 0 
 
 f u n c t i o n   T i m e F r o m S e c o n d s ( t ) { 
 
         v a r   z p a d   =   f u n c t i o n ( n ) { 
 
         v a r   s t r   =   n . t o S t r i n g ( ) ; 
 
                 r e t u r n   ( s t r . l e n g t h < 2 )   ?   " 0 " + s t r   :   s t r ; 
 
         } ; 
 
         v a r   h   =   M a t h . f l o o r ( t / 3 6 0 0 ) ;   t - = h * 3 6 0 0 ; 
 
         v a r   m   =   M a t h . f l o o r ( t / 6 0 ) ;   t - = m * 6 0 ; 
 
         v a r   s   =   M a t h . f l o o r ( t ) ; 
 
         i f ( h > 0 )   r e t u r n   h . t o S t r i n g ( ) + " : " + z p a d ( m ) + " : " + z p a d ( s ) ; 
 
         r e t u r n   m . t o S t r i n g ( ) + " : " + z p a d ( s ) ; 
 
 } ; 
 
 f u n c t i o n   T r a c k T y p e ( t r k p a t h )   { 
 
         v a r   t a g g a b l e ; 
 
         v a r   t y p e ; 
 
         s w i t c h   ( t r k p a t h )   { 
 
                 c a s e   " f i l e " : 
 
                 t a g g a b l e   =   1 ; 
 
                 t y p e   =   0 ; 
 
                 b r e a k ; 
 
                 c a s e   " c d d a " : 
 
                 t a g g a b l e   =   1 ; 
 
                 t y p e   =   1 ; 
 
                 b r e a k ; 
 
                 c a s e   " F O O _ " : 
 
                 t a g g a b l e   =   0 ; 
 
                 t y p e   =   2 ; 
 
                 b r e a k ; 
 
                 c a s e   " h t t p " : 
 
                 t a g g a b l e   =   0 ; 
 
                 t y p e   =   3 ; 
 
                 b r e a k ; 
 
                 c a s e   " m m s : " : 
 
                 t a g g a b l e   =   0 ; 
 
                 t y p e   =   3 ; 
 
                 b r e a k ; 
 
                 c a s e   " u n p a " : 
 
                 t a g g a b l e   =   0 ; 
 
                 t y p e   =   4 ; 
 
                 b r e a k ; 
 
                 d e f a u l t : 
 
                 t a g g a b l e   =   0 ; 
 
                 t y p e   =   5 ; 
 
         } ; 
 
         r e t u r n   t y p e ; 
 
 } ; 
 
 f u n c t i o n   r e p l a c e A l l ( s t r ,   s e a r c h ,   r e p l )   { 
 
     w h i l e   ( s t r . i n d e x O f ( s e a r c h )   ! =   - 1 )   { 
 
                 s t r   =   s t r . r e p l a c e ( s e a r c h ,   r e p l ) ; 
 
         } ; 
 
         r e t u r n   s t r ; 
 
 } ; 
 
 f u n c t i o n   r e m o v e A c c e n t s ( s t r )   { 
 
         v a r   n o r m   =   n e w   A r r a y ( '  ' , '  ' , '  ' , '  ' , '  ' , '  ' , '  ' , '  ' , '  ' , '  ' , '  ' , '  ' , 
 
         '  ' , '  ' , '  ' , '  ' ,   '  ' , '  ' , '  ' , '  ' , '  ' , '  ' , '  ' , '  ' , '  ' , '  ' , '  ' , '  ' , '  ' , 
 
         '  ' , '  ' ) ; 
 
         v a r   s p e c   =   n e w   A r r a y ( ' A ' , ' A ' , ' A ' , ' A ' , ' A ' , ' A ' , ' A E ' , ' C ' , ' E ' , ' E ' , ' E ' , ' E ' , 
 
         ' I ' , ' I ' , ' I ' , ' I ' ,   ' D ' , ' N ' , ' O ' , ' O ' , ' O ' , ' O ' , ' O ' , ' O ' , ' U ' , ' U ' , ' U ' , ' U ' , ' Y ' , 
 
         ' b ' , ' S S ' ) ; 
 
         f o r   ( v a r   i   =   0 ;   i   <   s p e c . l e n g t h ;   i + + )   { 
 
                 s t r   =   r e p l a c e A l l ( s t r ,   n o r m [ i ] ,   s p e c [ i ] ) ; 
 
         } ; 
 
         r e t u r n   s t r ; 
 
 } ; 
 
 / / } } 
 
 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = / /   B u t t o n   o b j e c t 
 
 B u t t o n S t a t e s   =   { n o r m a l :   0 ,   h o v e r :   1 ,   d o w n :   2 } ; 
 
 b u t t o n   =   f u n c t i o n   ( n o r m a l ,   h o v e r ,   d o w n )   { 
 
         t h i s . i m g   =   A r r a y ( n o r m a l ,   h o v e r ,   d o w n ) ; 
 
         t h i s . w   =   t h i s . i m g [ 0 ] . W i d t h ; 
 
         t h i s . h   =   t h i s . i m g [ 0 ] . H e i g h t ; 
 
         t h i s . s t a t e   =   B u t t o n S t a t e s . n o r m a l ; 
 
         t h i s . u p d a t e   =   f u n c t i o n   ( n o r m a l ,   h o v e r ,   d o w n )   { 
 
                 t h i s . i m g   =   A r r a y ( n o r m a l ,   h o v e r ,   d o w n ) ; 
 
         } ; 
 
         t h i s . d r a w   =   f u n c t i o n   ( g r ,   x ,   y ,   a l p h a )   { 
 
                 t h i s . x   =   x ; 
 
                 t h i s . y   =   y ; 
 
                 t h i s . i m g [ t h i s . s t a t e ]   & &   g r . D r a w I m a g e ( t h i s . i m g [ t h i s . s t a t e ] ,   t h i s . x ,   t h i s . y ,   t h i s . w ,   t h i s . h ,   0 ,   0 ,   t h i s . w ,   t h i s . h ,   0 ,   a l p h a ) ; 
 
         } ; 
 
         t h i s . d i s p l a y _ c o n t e x t _ m e n u   =   f u n c t i o n   ( x ,   y ,   i d )   { } ; 
 
         t h i s . r e p a i n t   =   f u n c t i o n   ( )   { 
 
           w i n d o w . R e p a i n t R e c t ( t h i s . x ,   t h i s . y ,   t h i s . w ,   t h i s . h ) ; 
 
         } ; 
 
         t h i s . c h e c k s t a t e   =   f u n c t i o n   ( e v e n t ,   x ,   y )   { 
 
                 t h i s . i s h o v e r   =   ( x   >   t h i s . x   & &   x   <   t h i s . x   +   t h i s . w   -   1   & &   y   >   t h i s . y   & &   y   <   t h i s . y   +   t h i s . h   -   1 ) ; 
 
                 t h i s . o l d   =   t h i s . s t a t e ; 
 
                 s w i t c h   ( e v e n t )   { 
 
                   c a s e   " d o w n " : 
 
                         s w i t c h ( t h i s . s t a t e )   { 
 
                           c a s e   B u t t o n S t a t e s . n o r m a l : 
 
                           c a s e   B u t t o n S t a t e s . h o v e r : 
 
                                 t h i s . s t a t e   =   t h i s . i s h o v e r   ?   B u t t o n S t a t e s . d o w n   :   B u t t o n S t a t e s . n o r m a l ; 
 
                                 b r e a k ; 
 
                         } ; 
 
                         b r e a k ; 
 
                   c a s e   " u p " : 
 
                         t h i s . s t a t e   =   t h i s . i s h o v e r   ?   B u t t o n S t a t e s . h o v e r   :   B u t t o n S t a t e s . n o r m a l ; 
 
                         b r e a k ; 
 
                   c a s e   " r i g h t " : 
 
                           i f ( t h i s . i s h o v e r )   t h i s . d i s p l a y _ c o n t e x t _ m e n u ( x ,   y ,   i d ) ; 
 
                           b r e a k ; 
 
                   c a s e   " m o v e " : 
 
                         s w i t c h ( t h i s . s t a t e )   { 
 
                           c a s e   B u t t o n S t a t e s . n o r m a l : 
 
                           c a s e   B u t t o n S t a t e s . h o v e r : 
 
                                 t h i s . s t a t e   =   t h i s . i s h o v e r   ?   B u t t o n S t a t e s . h o v e r   :   B u t t o n S t a t e s . n o r m a l ; 
 
                                 b r e a k ; 
 
                         } ; 
 
                         b r e a k ; 
 
                   c a s e   " l e a v e " : 
 
                         t h i s . s t a t e   =   t h i s . i s d o w n   ?   B u t t o n S t a t e s . d o w n   :   B u t t o n S t a t e s . n o r m a l ; 
 
                         b r e a k ; 
 
                 } ; 
 
                 i f ( t h i s . s t a t e ! = t h i s . o l d )   t h i s . r e p a i n t ( ) ; 
 
                 r e t u r n   t h i s . s t a t e ; 
 
         } ; 
 
 } ; 
 
 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = / /   T o o l s   ( g e n e r a l ) 
 
 f u n c t i o n   g e t _ s y s t e m _ s c r o l l b a r _ w i d t h ( )   { 
 
         v a r   t m p   =   u t i l s . G e t S y s t e m M e t r i c s ( S M _ C X V S C R O L L ) ; 
 
         r e t u r n   t m p ; 
 
 } ; 
 
 
 
 f u n c t i o n   g e t _ s y s t e m _ s c r o l l b a r _ h e i g h t ( )   { 
 
         v a r   t m p   =   u t i l s . G e t S y s t e m M e t r i c s ( S M _ C Y H S C R O L L ) ; 
 
         r e t u r n   t m p ; 
 
 } ; 
 
 / * 
 
 S t r i n g . p r o t o t y p e . r e p e a t   =   f u n c t i o n ( n u m )   { 
 
         r e t u r n   n e w   A r r a y ( n u m + 1 ) . j o i n ( t h i s ) ; 
 
 } ; 
 
 * / 
 
 S t r i n g . p r o t o t y p e . r e p e a t   =   f u n c t i o n ( n u m )   { 
 
         i f ( n u m > = 0   & &   n u m < = 5 )   { 
 
                 v a r   g   =   M a t h . r o u n d ( n u m ) ; 
 
         }   e l s e   { 
 
                 r e t u r n   " " ; 
 
         } ; 
 
         r e t u r n   n e w   A r r a y ( g + 1 ) . j o i n ( t h i s ) ; 
 
 } ; 
 
 
 
 f u n c t i o n   g e t T i m e s t a m p ( )   { 
 
         v a r   d ,   s 1 ,   s 2 ,   s 3 ,   h h ,   m i n ,   s e c ,   t i m e s t a m p ; 
 
         d   =   n e w   D a t e ( ) ; 
 
         s 1   =   d . g e t F u l l Y e a r ( ) ; 
 
         s 2   =   ( d . g e t M o n t h ( )   +   1 ) ; 
 
         s 3   =   d . g e t D a t e ( ) ; 
 
         h h   =   d . g e t H o u r s ( ) ; 
 
         m i n   =   d . g e t M i n u t e s ( ) ; 
 
         s e c   =   d . g e t S e c o n d s ( ) ; 
 
         i f ( s 3 . l e n g t h   = =   1 )   s 3   =   " 0 "   +   s 3 ; 
 
         t i m e s t a m p   =   s 1   +   ( ( s 2   <   1 0 )   ?   " - 0 "   :   " - " )   +   s 2   +   ( ( s 3   <   1 0 )   ?   " - 0 "   :   " - "   )   +   s 3   +   ( ( h h   <   1 0 )   ?   "   0 "   :   "   " )   +   h h   +   ( ( m i n   <   1 0 )   ?   " : 0 "   :   " : " )   +   m i n   +   ( ( s e c   <   1 0 )   ?   " : 0 "   :   " : " )   +   s e c ; 
 
         r e t u r n   t i m e s t a m p ; 
 
 } ; 
 
 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = / /   S o r t   p a t t e r n   u s e d   i n   t h i s   p a n e l 
 
 v a r   s o r t _ p a t t e r n _ a l b u m   =   w i n d o w . G e t P r o p e r t y ( " S Y S T E M . s o r t _ p a t t e r n _ a l b u m " ,   " % a l b u m   a r t i s t % | $ i f ( % a l b u m % , $ i f 2 ( % d a t e % , 9 9 9 9 ) , 0 0 0 0 ) | % a l b u m % | % d i s c n u m b e r % | % t r a c k n u m b e r % " ) ; 
 
 v a r   s o r t _ p a t t e r n _ a r t i s t   =   w i n d o w . G e t P r o p e r t y ( " S Y S T E M . s o r t _ p a t t e r n _ a r t i s t " ,   " % a r t i s t % | $ i f ( % a l b u m % , $ i f 2 ( % d a t e % , 9 9 9 9 ) , 0 0 0 0 ) | % a l b u m % | % d i s c n u m b e r % | % t r a c k n u m b e r % " ) ; 
 
 v a r   s o r t _ p a t t e r n _ p a t h   =   w i n d o w . G e t P r o p e r t y ( " S Y S T E M . s o r t _ p a t t e r n _ p a t h " ,   " % p a t h % " ) ; 
 
 v a r   s o r t _ p a t t e r n _ d a t e   =   w i n d o w . G e t P r o p e r t y ( " S Y S T E M . s o r t _ p a t t e r n _ d a t e " ,   " % d a t e % " ) ; 
 
 v a r   s o r t _ p a t t e r n _ g e n r e   =   w i n d o w . G e t P r o p e r t y ( " S Y S T E M . s o r t _ p a t t e r n _ g e n r e " ,   " % g e n r e % " ) ; 
 
 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = / /   G r o u p   p a t t e r n   u s e d   i n   t h i s   p a n e l 
 
 v a r   g r o u p _ p a t t e r n _ a l b u m   =   w i n d o w . G e t P r o p e r t y ( " S Y S T E M . g r o u p _ p a t t e r n _ a l b u m " ,   " % a l b u m   a r t i s t % % a l b u m % % d i s c n u m b e r % " ) ; 
 
 v a r   g r o u p _ p a t t e r n _ a r t i s t   =   w i n d o w . G e t P r o p e r t y ( " S Y S T E M . g r o u p _ p a t t e r n _ a r t i s t " ,   " % a r t i s t % " ) ; 
 
 v a r   g r o u p _ p a t t e r n _ p a t h   =   w i n d o w . G e t P r o p e r t y ( " S Y S T E M . g r o u p _ p a t t e r n _ p a t h " ,   " % d i r e c t o r y % " ) ; 
 
 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = / /   I m a g e   d e c l a r a t i o n s 
 
 v a r   p l a y i c o n _ o f f ; 
 
 v a r   p l a y i c o n _ o n ; 
 
 v a r   n o c o v e r ; 
 
 v a r   n o c o v e r _ i m g ; 
 
 v a r   n o a r t i s t ; 
 
 v a r   n o a r t i s t _ i m g ; 
 
 v a r   s t r e a m c o v e r ; 
 
 v a r   s t r e a m c o v e r _ i m g ; 
 
 v a r   g l a s s _ r e f l e c t _ i m g ; 
 
 v a r   i c o n _ a r r o w _ l e f t ; 
 
 v a r   s i n g l e l i n e _ g r o u p _ h e a d e r _ i c o n ; 
 
 v a r   b t _ s e t t i n g s _ o f f ; 
 
 v a r   b t _ s e t t i n g s _ o v ; 
 
 v a r   b t _ s e t t i n g s _ o n ; 
 
 v a r   b t _ s o r t _ o f f ; 
 
 v a r   b t _ s o r t _ o v ; 
 
 v a r   b t _ s o r t _ o n ; 
 
 
 
 f u n c t i o n   o n _ g e t _ a l b u m _ a r t _ d o n e ( m e t a d b ,   a r t _ i d ,   i m a g e ,   i m a g e _ p a t h )   { 
 
         v a r   d r a w _ l i m i t   =   l i s t . t o c u t + l i s t . n b v i s + g r o u p . n b r o w s + 1 ; 
 
         i f ( d r a w _ l i m i t > l i s t . i t e m . l e n g t h )   d r a w _ l i m i t   =   l i s t . i t e m . l e n g t h ; 
 
         f o r ( v a r   i = l i s t . t o c u t ; i < d r a w _ l i m i t ; i + + )   { 
 
                 i f ( l i s t . i t e m [ i ] . m e t a d b   & &   l i s t . i t e m [ i ] . g r i d x = = g r o u p . n b r o w s )   { 
 
                         i f ( l i s t . i t e m [ i ] . m e t a d b . C o m p a r e ( m e t a d b ) )   { 
 
                                 l i s t . i t e m [ i ] . c o v e r _ i m g   =   g _ i m a g e _ c a c h e . g e t i t ( l i s t . i t e m [ i ] ,   i m a g e ) ; 
 
                                 v a r   c x   =   l i s t . i t e m [ i ] . x   +   c o v e r . m a r g i n ; 
 
                                 v a r   c y   =   l i s t . i t e m [ i ] . y   -   ( ( g r o u p . n b r o w s - 1 ) * r o w . h ) ; 
 
                                 c x   =   c o v e r . m a r g i n ; 
 
                                 c y   =   l i s t . i t e m [ i ] . y   -   ( ( g r o u p . n b r o w s - 1 ) * r o w . h ) ; 
 
                                 / /   f i x   f o r   a   w e i r d   b e h a v i o u r   w i t h   e n g i n e   J s c r i p t 9 
 
                                 i f ( ! c x )   c x   =   2 ;   e l s e   i f ( c x < 2 )   c x   =   2 ; 
 
                                 i f ( ! c y )   c y   =   2 ;   e l s e   i f ( c y < 2 )   c y   =   2 ; 
 
                                 w i n d o w . R e p a i n t R e c t ( c x - 2 ,   c y - 2 ,   g r o u p . n b r o w s * r o w . h ,   g r o u p . n b r o w s * r o w . h ) ; 
 
                                 b r e a k ; 
 
                         } ; 
 
                 } ; 
 
         } ; 
 
 } ; 
 
 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = / /   C o v e r   T o o l s 
 
 i m a g e _ c a c h e   =   f u n c t i o n   ( )   { 
 
         t h i s . _ c a c h e l i s t   =   { } ; 
 
         t h i s . h i t   =   f u n c t i o n   ( i t e m )   { 
 
                 v a r   i m g   =   t h i s . _ c a c h e l i s t [ i t e m . m e t a d b . P a t h ] ; 
 
                 i f   ( t y p e o f   i m g   = =   " u n d e f i n e d " )   { 
 
                         i f ( ! c o v e r . l o a d _ t i m e r & & ! l b d n )   {   / / = = = = = = =   a d d e d 
 
                                 c o v e r . l o a d _ t i m e r   =   w i n d o w . S e t T i m e o u t ( f u n c t i o n ( )   { 
 
                                         s w i t c h ( g r o u p . t y p e ) { 
 
                                                 c a s e   0 : 
 
                                                         v a r   a r t _ i d   =   A l b u m A r t I d . f r o n t ; 
 
                                                         b r e a k ; 
 
                                                 c a s e   1 : 
 
                                                         v a r   a r t _ i d   =   A l b u m A r t I d . a r t i s t ; 
 
                                                         b r e a k ; 
 
                                                 c a s e   2 : 
 
                                                         v a r   a r t _ i d   =   A l b u m A r t I d . f r o n t ; 
 
                                                         b r e a k ; 
 
                                         } ; 
 
                                         u t i l s . G e t A l b u m A r t A s y n c ( w i n d o w . I D ,   i t e m . m e t a d b ,   a r t _ i d ,   t r u e ,   f a l s e ,   f a l s e ) ; 
 
                                         c o v e r . l o a d _ t i m e r   & &   w i n d o w . C l e a r T i m e o u t ( c o v e r . l o a d _ t i m e r ) ; 
 
                                         c o v e r . l o a d _ t i m e r   =   f a l s e ; 
 
                                 } ,   3 5 ) ; 
 
                         } ; 
 
                 } ; 
 
                 r e t u r n   i m g ; 
 
         } ; 
 
         t h i s . g e t i t   =   f u n c t i o n   ( i t e m ,   i m a g e ,   i m a g e _ p a t h )   { 
 
                 v a r   i m g ; 
 
                 i f ( c o v e r . k e e p a s p e c t r a t i o )   { 
 
                         i f ( ! i m a g e )   { 
 
                                 v a r   p w   =   ( c o v e r . w - c o v e r . m a r g i n * 2 ) ; 
 
                                 v a r   p h   =   ( c o v e r . h - c o v e r . m a r g i n * 2 ) ; 
 
                         }   e l s e   { 
 
                                 i f ( i m a g e . H e i g h t > = i m a g e . W i d t h )   { 
 
                                         v a r   r a t i o   =   i m a g e . W i d t h   /   i m a g e . H e i g h t ; 
 
                                         v a r   p w   =   ( c o v e r . w - c o v e r . m a r g i n * 2 ) * r a t i o ; 
 
                                         v a r   p h   =   ( c o v e r . h - c o v e r . m a r g i n * 2 ) ; 
 
                                 }   e l s e   { 
 
                                         v a r   r a t i o   =   i m a g e . H e i g h t   /   i m a g e . W i d t h ; 
 
                                         v a r   p w   =   ( c o v e r . w - c o v e r . m a r g i n * 2 ) ; 
 
                                         v a r   p h   =   ( c o v e r . h - c o v e r . m a r g i n * 2 ) * r a t i o ; 
 
                                 } ; 
 
                         } ; 
 
                 }   e l s e   { 
 
                         v a r   p w   =   c o v e r . w - c o v e r . m a r g i n * 2 ; 
 
                         v a r   p h   =   c o v e r . h - c o v e r . m a r g i n * 2 ; 
 
                 } ; 
 
                 / /   i t e m . c o v e r _ t y p e   :   0   =   n o c o v e r ,   1   =   e x t e r n a l   c o v e r ,   2   =   e m b e d d e d   c o v e r ,   3   =   s t r e a m 
 
                 / / i f ( i t e m . t r a c k _ t y p e ! = 3 )   { 
 
                         i f ( i t e m . m e t a d b )   { 
 
                                 i m g   =   F o r m a t C o v e r ( i m a g e ,   p w ,   p h ) ; 
 
                                 i f ( ! i m g )   { 
 
                                         i m g   =   ( g r o u p . t y p e = = 1 ) ? n o a r t i s t _ i m g : n o c o v e r _ i m g ; 
 
                                         i t e m . c o v e r _ t y p e   =   0 ; 
 
                                 }   e l s e   { 
 
                                         i t e m . c o v e r _ t y p e   =   1 ; 
 
                                 } ; 
 
                         } ; 
 
                 / / }   e l s e   { 
 
                         / / i m g   =   s t r e a m c o v e r _ i m g ; 
 
                         / / i t e m . c o v e r _ t y p e   =   3 ; 
 
                 / / } ;       
 
                 t h i s . _ c a c h e l i s t [ i t e m . m e t a d b . P a t h ]   =   i m g ; 
 
                 r e t u r n   i m g ; 
 
         } ; 
 
 } ; 
 
 v a r   g _ i m a g e _ c a c h e   =   n e w   i m a g e _ c a c h e ; 
 
 
 
 f u n c t i o n   F o r m a t C o v e r ( i m a g e ,   w ,   h )   { 
 
 	 i f ( ! i m a g e   | |   w < = 0   | |   h < = 0 )   r e t u r n   i m a g e ; 
 
         i f ( c o v e r . d r a w _ g l a s s _ e f f e c t )   { 
 
                 v a r   n e w _ i m g   =   i m a g e . R e s i z e ( w ,   h ,   2 ) ; 
 
                 v a r   g b   =   n e w _ i m g . G e t G r a p h i c s ( ) ; 
 
                 i f ( h > w )   { 
 
                         g b . D r a w I m a g e ( g l a s s _ r e f l e c t _ i m g ,   M a t h . f l o o r ( ( h - w ) / 2 ) * - 1 + 1 ,   1 ,   h - 2 ,   h - 2 ,   0 ,   0 ,   g l a s s _ r e f l e c t _ i m g . W i d t h ,   g l a s s _ r e f l e c t _ i m g . H e i g h t ,   0 ,   1 5 0 ) ; 
 
                 }   e l s e   { 
 
                         g b . D r a w I m a g e ( g l a s s _ r e f l e c t _ i m g ,   1 ,   M a t h . f l o o r ( ( w - h ) / 2 ) * - 1 + 1 ,   w - 2 ,   w - 2 ,   0 ,   0 ,   g l a s s _ r e f l e c t _ i m g . W i d t h ,   g l a s s _ r e f l e c t _ i m g . H e i g h t ,   0 ,   1 5 0 ) ; 
 
                 } ; 
 
                 n e w _ i m g . R e l e a s e G r a p h i c s ( g b ) ; 
 
                 r e t u r n   n e w _ i m g ; 
 
         }   e l s e   { 
 
                 r e t u r n   i m a g e . R e s i z e ( w ,   h ,   2 ) ; 
 
         } ; 
 
 } ; 
 
 
 
 f u n c t i o n   F o r m a t W P ( i m a g e ,   w ,   h )   { 
 
 	 i f ( ! i m a g e   | |   w < = 0   | |   h < = 0 )   r e t u r n   i m a g e ; 
 
         r e t u r n   i m a g e . R e s i z e ( w ,   h ,   2 ) ; 
 
 } ; 
 
 
 
 f u n c t i o n   d r a w _ g l a s s _ r e f l e c t ( w ,   h )   { 
 
         / /   M a s k   f o r   g l a s s   e f f e c t 
 
         v a r   M a s k _ i m g   =   g d i . C r e a t e I m a g e ( w ,   h ) ; 
 
         v a r   g b   =   M a s k _ i m g . G e t G r a p h i c s ( ) ; 
 
         g b . F i l l S o l i d R e c t ( 0 , 0 , w , h , 0 x f f f f f f f f ) ; 
 
         g b . F i l l G r a d R e c t ( 0 , 0 , w - 2 0 , h , 0 , 0 x a a 0 0 0 0 0 0 , 0 , 1 . 0 ) ; 
 
         g b . S e t S m o o t h i n g M o d e ( 2 ) ; 
 
         g b . F i l l E l l i p s e ( - 2 0 ,   2 5 ,   w * 2 + 4 0 ,   h * 2 ,   0 x f f f f f f f f ) ; 
 
         M a s k _ i m g . R e l e a s e G r a p h i c s ( g b ) ; 
 
         / /   d r a w i n g   t h e   w h i t e   r e c t 
 
         v a r   g l a s s _ i m g   =   g d i . C r e a t e I m a g e ( w ,   h ) ; 
 
         g b   =   g l a s s _ i m g . G e t G r a p h i c s ( ) ; 
 
         g b . F i l l S o l i d R e c t ( 0 ,   0 ,   w ,   h ,   0 x f f f f f f f f ) ; 
 
         g l a s s _ i m g . R e l e a s e G r a p h i c s ( g b ) ; 
 
         / /   r e s i z i n g   a n d   a p p l y i n g   t h e   m a s k 
 
         v a r   M a s k   =   M a s k _ i m g . R e s i z e ( w ,   h ) ; 
 
         g l a s s _ i m g . A p p l y M a s k ( M a s k ) ; 
 
         M a s k . D i s p o s e ( ) ; 
 
         r e t u r n   g l a s s _ i m g ; 
 
 } ; 
 
 
 
 f u n c t i o n   r e s e t _ c o v e r _ t i m e r s ( )   { 
 
         c o v e r . l o a d _ t i m e r   & &   w i n d o w . C l e a r T i m e o u t ( c o v e r . l o a d _ t i m e r ) ; 
 
         c o v e r . l o a d _ t i m e r   =   f a l s e ; 
 
 } ; 
 
 
 
 f u n c t i o n   r e p a i n t _ r a t i n g ( r y )   { 
 
         i f ( ! c o l u m n s . r a t i n g _ t i m e r I D )   { 
 
                 / / c o l u m n s . r a t i n g _ t i m e r I D   =   w i n d o w . S e t T i m e o u t ( f u n c t i o n ( )   { 
 
                         w i n d o w . R e p a i n t R e c t ( c o l u m n s . r a t i n g _ x ,   r y ,   c o l u m n s . r a t i n g _ w ,   r o w . h ) ; 
 
                         c o l u m n s . r a t i n g _ t i m e r I D   & &   w i n d o w . C l e a r T i m e o u t ( c o l u m n s . r a t i n g _ t i m e r I D ) ; 
 
                         c o l u m n s . r a t i n g _ t i m e r I D   =   f a l s e ; 
 
                 / / } , 5 0 ) ; 
 
         } ; 
 
 } ; 
 
 
 
 f u n c t i o n   r e p a i n t _ m o o d ( r y )   { 
 
         i f ( ! c o l u m n s . m o o d _ t i m e r I D )   { 
 
                 / / c o l u m n s . m o o d _ t i m e r I D   =   w i n d o w . S e t T i m e o u t ( f u n c t i o n ( )   { 
 
                         w i n d o w . R e p a i n t R e c t ( c o l u m n s . m o o d _ x ,   r y ,   c o l u m n s . m o o d _ w ,   r o w . h ) ; 
 
                         c o l u m n s . m o o d _ t i m e r I D   & &   w i n d o w . C l e a r T i m e o u t ( c o l u m n s . m o o d _ t i m e r I D ) ; 
 
                         c o l u m n s . m o o d _ t i m e r I D   =   f a l s e ; 
 
                 / / } , 2 5 ) ; 
 
         } ; 
 
 } ; 
 
 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = / /   I t e m   O b j e c t 
 
 I t e m S t a t e s   =   { n o r m a l :   0 ,   h o v e r :   1 ,   s e l e c t e d :   2 } ; 
 
 i t e m   =   f u n c t i o n   ( i d ,   i d x ,   g r i d x )   { 
 
         i f   ( t y p e o f   t h i s . i d   = =   " u n d e f i n e d " )   { 
 
                 t h i s . i d   =   i d ; 
 
                 t h i s . i d x   =   i d x ; 
 
                 t h i s . g r i d x   =   g r i d x ; 
 
                 t h i s . g r p _ i d x   =   0 ; 
 
                 t h i s . m e t a d b   =   l i s t . h a n d l e l i s t . I t e m ( t h i s . i d ) ; 
 
                 t h i s . x   =   0 ; 
 
                 t h i s . d e f a u l t y   =   t o o l b a r . h   +   ( i d x )   *   r o w . h ; 
 
                 t h i s . w   =   w w ; 
 
                 t h i s . h   =   r o w . h ; 
 
                 t h i s . l _ r a t i n g   =   0 ; 
 
                 t h i s . l _ m o o d   =   0 ; 
 
                 t h i s . t o o l t i p   =   f a l s e ; 
 
                 i f ( t h i s . m e t a d b )   { 
 
                         t h i s . a l b u m a r t i s t   =   t f _ a l b u m a r t i s t . E v a l W i t h M e t a d b ( t h i s . m e t a d b ) ; 
 
                         t h i s . a l b u m   =   t f _ a l b u m . E v a l W i t h M e t a d b ( t h i s . m e t a d b ) ; 
 
                         t h i s . g r o u p _ k e y   =   t f _ g r o u p _ k e y . E v a l W i t h M e t a d b ( t h i s . m e t a d b ) ; 
 
                         t h i s . t r a c k _ t y p e   =   T r a c k T y p e ( t h i s . m e t a d b . r a w p a t h . s u b s t r i n g ( 0 , 4 ) ) ; 
 
                         i f ( t h i s . g r i d x = = 0 )   { 
 
                                 t h i s . t r a c k n u m b e r   =   t f _ t r a c k n u m b e r . E v a l W i t h M e t a d b ( t h i s . m e t a d b ) ; 
 
                                 t h i s . a r t i s t   =   t f _ a r t i s t . E v a l W i t h M e t a d b ( t h i s . m e t a d b ) ; 
 
                                 t h i s . t i t l e   =   t f _ t i t l e . E v a l W i t h M e t a d b ( t h i s . m e t a d b ) ; 
 
                                 t h i s . p l a y c o u n t   =   c o l u m n s . p l a y c o u n t   ?   t f _ p l a y c o u n t . E v a l W i t h M e t a d b ( t h i s . m e t a d b )   :   0 ; 
 
                                 t h i s . d u r a t i o n   =   t f _ d u r a t i o n . E v a l W i t h M e t a d b ( t h i s . m e t a d b ) ; 
 
                                 t h i s . m o o d   =   c o l u m n s . m o o d   ?   t f _ m o o d . E v a l W i t h M e t a d b ( t h i s . m e t a d b )   :   0 ; 
 
                                 t h i s . r a t i n g   =   c o l u m n s . r a t i n g   ?   t f _ r a t i n g . E v a l W i t h M e t a d b ( t h i s . m e t a d b )   :   0 ; 
 
                                 t h i s . b i t r a t e   =   c o l u m n s . b i t r a t e   ?   t f _ b i t r a t e . E v a l W i t h M e t a d b ( t h i s . m e t a d b )   :   " " ; 
 
                         }   e l s e   { 
 
                                 t h i s . g e n r e   =   t f _ g e n r e . E v a l W i t h M e t a d b ( t h i s . m e t a d b ) ; 
 
                                 t h i s . d a t e   =   t f _ d a t e . E v a l W i t h M e t a d b ( t h i s . m e t a d b ) ; 
 
                                 t h i s . c o d e c   =   t f _ c o d e c . E v a l W i t h M e t a d b ( t h i s . m e t a d b ) ; 
 
                                 t h i s . s a m p l e r a t e   =   t f _ s a m p l e r a t e . E v a l W i t h M e t a d b ( t h i s . m e t a d b ) ; 
 
                                 t h i s . b i t r a t e 2   =   t f _ b i t r a t e 2 . E v a l W i t h M e t a d b ( t h i s . m e t a d b ) ; 
 
                                 t h i s . b i t s p e r s a m p l e   =   t f _ b i t s p e r s a m p l e . E v a l W i t h M e t a d b ( t h i s . m e t a d b ) ; 
 
                                 t h i s . d i s c _ i n f o   =   t f _ d i s c _ i n f o . E v a l W i t h M e t a d b ( t h i s . m e t a d b ) ; 
 
                         } ; 
 
                 } ; 
 
         } ; 
 
 
 
 
 
         t h i s . u p d a t e _ i n f o s   =   f u n c t i o n ( )   { 
 
                 i f ( t h i s . m e t a d b )   { 
 
                         t h i s . a l b u m a r t i s t   =   t f _ a l b u m a r t i s t . E v a l W i t h M e t a d b ( t h i s . m e t a d b ) ; 
 
                         t h i s . a l b u m   =   t f _ a l b u m . E v a l W i t h M e t a d b ( t h i s . m e t a d b ) ; 
 
                         t h i s . g r o u p _ k e y   =   t f _ g r o u p _ k e y . E v a l W i t h M e t a d b ( t h i s . m e t a d b ) ; 
 
                         t h i s . t r a c k _ t y p e   =   T r a c k T y p e ( t h i s . m e t a d b . r a w p a t h . s u b s t r i n g ( 0 , 4 ) ) ; 
 
                         i f ( t h i s . g r i d x = = 0 )   { 
 
                                 t h i s . t r a c k n u m b e r   =   t f _ t r a c k n u m b e r . E v a l W i t h M e t a d b ( t h i s . m e t a d b ) ; 
 
                                 t h i s . a r t i s t   =   t f _ a r t i s t . E v a l W i t h M e t a d b ( t h i s . m e t a d b ) ; 
 
                                 t h i s . t i t l e   =   t f _ t i t l e . E v a l W i t h M e t a d b ( t h i s . m e t a d b ) ; 
 
                                 t h i s . p l a y c o u n t   =   t f _ p l a y c o u n t . E v a l W i t h M e t a d b ( t h i s . m e t a d b ) ; 
 
                                 t h i s . d u r a t i o n   =   t f _ d u r a t i o n . E v a l W i t h M e t a d b ( t h i s . m e t a d b ) ; 
 
                                 t h i s . m o o d   =   c o l u m n s . m o o d   ?   t f _ m o o d . E v a l W i t h M e t a d b ( t h i s . m e t a d b )   :   0 ; 
 
                                 t h i s . r a t i n g   =   c o l u m n s . r a t i n g   ?   t f _ r a t i n g . E v a l W i t h M e t a d b ( t h i s . m e t a d b )   :   0 ; 
 
                                 t h i s . b i t r a t e   =   c o l u m n s . b i t r a t e   ?   t f _ b i t r a t e . E v a l W i t h M e t a d b ( t h i s . m e t a d b )   :   " " ; 
 
                         }   e l s e   { 
 
                                 t h i s . g e n r e   =   t f _ g e n r e . E v a l W i t h M e t a d b ( t h i s . m e t a d b ) ; 
 
                                 t h i s . d a t e   =   t f _ d a t e . E v a l W i t h M e t a d b ( t h i s . m e t a d b ) ; 
 
                                 t h i s . c o d e c   =   t f _ c o d e c . E v a l W i t h M e t a d b ( t h i s . m e t a d b ) ; 
 
                                 t h i s . s a m p l e r a t e   =   t f _ s a m p l e r a t e . E v a l W i t h M e t a d b ( t h i s . m e t a d b ) ; 
 
                                 t h i s . b i t r a t e 2   =   t f _ b i t r a t e 2 . E v a l W i t h M e t a d b ( t h i s . m e t a d b ) ; 
 
                                 t h i s . b i t s p e r s a m p l e   =   t f _ b i t s p e r s a m p l e . E v a l W i t h M e t a d b ( t h i s . m e t a d b ) ; 
 
                                 t h i s . d i s c _ i n f o   =   t f _ d i s c _ i n f o . E v a l W i t h M e t a d b ( t h i s . m e t a d b ) ; 
 
                         } ; 
 
                 } ; 
 
         } ; 
 
 
 
 
 
         t h i s . d r a w   =   f u n c t i o n ( g r ,   i d ,   i d x )   { 
 
                 t h i s . y   =   t h i s . d e f a u l t y   -   ( l i s t . t o c u t   *   r o w . h ) ; 
 
                 i f ( t h i s . g r i d x = = 0 )   { 
 
                         / /   - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   : : :   D r a w   i t e m 
 
                         / /   - - - - - - - - - - - - - - - - - - - - - 
 
                         i f ( l i s t . f o c u s _ i d = = t h i s . i d )   { 
 
                                 / /   f o c u s e d   i t e m   b g 
 
                                 v a r   s t a t e   =   2 ; 
 
                                 t r y   { 
 
                                         l i s t . t h e m e . S e t P a r t A n d S t a t e I d ( 6 ,   1 0 ) ; 
 
                                         l i s t . t h e m e . D r a w T h e m e B a c k g r o u n d ( g r ,   t h i s . x ,   t h i s . y ,   w w - v s c r o l l b a r . w ,   t h i s . h ) ; 
 
                                 }   c a t c h ( e )   { 
 
                                         g r . S e t S m o o t h i n g M o d e ( 2 ) ; 
 
                                         g r . D r a w R o u n d R e c t ( t h i s . x + 1 ,   t h i s . y ,   t h i s . w - v s c r o l l b a r . w - 3 ,   t h i s . h - 1 ,   2 ,   2 ,   1 . 0 ,   p p t . g _ t e x t c o l o r _ s e l _ i t e m & 0 x 2 0 f f f f f f ) ; / / g _ t e x t c o l o r 
 
                                         g r . F i l l G r a d R e c t ( t h i s . x + 2 ,   t h i s . y ,   t h i s . w - v s c r o l l b a r . w - 4 ,   t h i s . h - 1 ,   9 0 ,   0 ,   p p t . g _ t e x t c o l o r _ s e l _ i t e m & R G B A ( 2 5 5 , 2 5 5 , 2 5 5 , p p t . i t e m _ s e l e c t _ a l p h a ) ,   1 . 0 ) ;   / /   R G B A ( 2 5 5 , 2 5 5 , 2 5 5 , p p t . p r o g r e s s _ b a r _ a l p h a )     0 x 1 5 f f f f f f   g _ t e x t c o l o r 
 
                                         g r . S e t S m o o t h i n g M o d e ( 0 ) ; 
 
                                 } ; 
 
                         }   e l s e   { 
 
                                 i f ( p l m a n . I s P l a y l i s t I t e m S e l e c t e d ( p l m a n . A c t i v e P l a y l i s t ,   t h i s . i d ) )   { 
 
                                         / /   s e l e c t e d   i t e m   b g 
 
                                         v a r   s t a t e   =   1 ; 
 
                                         t r y   { 
 
                                                 l i s t . t h e m e . S e t P a r t A n d S t a t e I d ( 6 ,   1 0 ) ; 
 
                                                 l i s t . t h e m e . D r a w T h e m e B a c k g r o u n d ( g r ,   t h i s . x ,   t h i s . y ,   w w - v s c r o l l b a r . w ,   t h i s . h ) ; 
 
                                         }   c a t c h ( e )   { 
 
                                                 g r . S e t S m o o t h i n g M o d e ( 2 ) ; 
 
                                                 g r . D r a w R o u n d R e c t ( t h i s . x + 1 ,   t h i s . y ,   t h i s . w - v s c r o l l b a r . w - 3 ,   t h i s . h - 1 ,   2 ,   2 ,   1 . 0 ,   p p t . g _ t e x t c o l o r _ s e l _ i t e m & 0 x 2 0 f f f f f f ) ;   / / g _ t e x t c o l o r & 0 x 2 0 f f f f f f ) ; 
 
                                                 g r . F i l l G r a d R e c t ( t h i s . x + 2 ,   t h i s . y ,   t h i s . w - v s c r o l l b a r . w - 4 ,   t h i s . h - 1 ,   9 0 ,   0 ,   p p t . g _ t e x t c o l o r _ s e l _ i t e m & R G B A ( 2 5 5 , 2 5 5 , 2 5 5 , p p t . i t e m _ s e l e c t _ a l p h a ) ,   1 . 0 ) ;   / / g _ t e x t c o l o r & 0 x 1 5 f f f f f f ,   1 . 0 ) ; 
 
                                                 g r . S e t S m o o t h i n g M o d e ( 0 ) ; 
 
                                         } ; 
 
                                 }   e l s e   { 
 
                                         / /   d e f a u l t   i t e m   b g   ( o d d / e v e n ) 
 
                                         v a r   s t a t e   =   0 ; 
 
                                         i f ( M a t h . f l o o r ( t h i s . g r p _ i d x / 2 )   = =   t h i s . g r p _ i d x / 2 )   { 
 
                                                 g r . F i l l S o l i d R e c t ( t h i s . x ,   t h i s . y ,   t h i s . w - v s c r o l l b a r . w ,   t h i s . h ,   R G B A ( 2 5 5 , 2 5 5 , 2 5 5 , 5 ) ) ; 
 
                                         }   e l s e   { 
 
                                                 g r . F i l l S o l i d R e c t ( t h i s . x ,   t h i s . y ,   t h i s . w - v s c r o l l b a r . w ,   t h i s . h ,   R G B A ( 0 , 0 , 0 , 5 ) ) ; 
 
                                         } ; 
 
                                         i f ( l i s t . g r a d i e n t _ l i n e s _ s h o w )   { 
 
                                                 g r . F i l l G r a d R e c t ( t h i s . x + 3 0 ,   t h i s . y ,   t h i s . w - v s c r o l l b a r . w - 6 0 ,   1 ,   0 ,   0 ,   R G B A ( 0 , 0 , 0 , 8 0 ) ,   0 . 5 ) ; 
 
                                                 g r . F i l l G r a d R e c t ( t h i s . x + 3 0 ,   t h i s . y + 1 ,   t h i s . w - v s c r o l l b a r . w - 6 0 ,   1 ,   0 ,   0 ,   R G B A ( 2 5 5 , 2 5 5 , 2 5 5 , 1 5 ) ,   0 . 5 ) ; 
 
                                         } ; 
 
                                 } ; 
 
                         } ; 
 
                         
 
                         / /   l a s t   i t e m   s h a d o w   e f f e c t 
 
                         i f ( t h i s . i d = = l i s t . t o t a l - 1 )   { 
 
                                 g r . F i l l S o l i d R e c t ( t h i s . x ,   t h i s . y + t h i s . h + 0 ,   t h i s . w - v s c r o l l b a r . w ,   1 ,   R G B A ( 0 , 0 , 0 , 7 5 ) ) ; 
 
                                 g r . F i l l S o l i d R e c t ( t h i s . x ,   t h i s . y + t h i s . h + 1 ,   t h i s . w - v s c r o l l b a r . w ,   1 ,   R G B A ( 0 , 0 , 0 , 3 5 ) ) ; 
 
                                 g r . F i l l S o l i d R e c t ( t h i s . x ,   t h i s . y + t h i s . h + 2 ,   t h i s . w - v s c r o l l b a r . w ,   1 ,   R G B A ( 0 , 0 , 0 , 1 2 ) ) ; 
 
                         } ; 
 
                         
 
                         / /   * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
 
                         / /   . s t a r t .   * * *   c o l s   m e t r i c s   * * * 
 
                         / /   * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
 
                         c o l u m n s . p l a y i c o n _ x   =   0 ; 
 
                         i f ( c o l u m n s . p l a y i c o n )   { 
 
                                 c o l u m n s . p l a y i c o n _ w   =   ( c o v e r . m a r g i n   +   2 0 ) ; 
 
                         }   e l s e   { 
 
                                 c o l u m n s . p l a y i c o n _ w   =   3 ; 
 
                         } ; 
 
                         / / 
 
                         c o l u m n s . t r a c k n u m b e r _ x   =   c o l u m n s . p l a y i c o n _ x   +   c o l u m n s . p l a y i c o n _ w ; 
 
                         i f ( c o l u m n s . t r a c k n u m b e r )   { 
 
                                 c o l u m n s . t r a c k n u m b e r _ w   =   4 0 ; 
 
                         }   e l s e   { 
 
                                 c o l u m n s . t r a c k n u m b e r _ w   =   5 ; 
 
                         } ; 
 
                         / / 
 
                         i f ( c o l u m n s . r a t i n g   | |   c o l u m n s . b i t r a t e   | |   c o l u m n s . m o o d )   { 
 
                                 i f ( c o l u m n s . d u r a t i o n _ w < = 0 )   { 
 
                                         c o l u m n s . d u r a t i o n _ w   =   g r . C a l c T e x t W i d t h ( " 0 0 : 0 0 : 0 0 " ,   g _ f o n t ) ; 
 
                                 } ; 
 
                         }   e l s e   { 
 
                                 c o l u m n s . d u r a t i o n _ w   =   g r . C a l c T e x t W i d t h ( "   - " + t h i s . d u r a t i o n ,   g _ f o n t ) ; 
 
                         } ; 
 
                         / / 
 
                         c o l u m n s . d u r a t i o n _ x   =   w w - v s c r o l l b a r . w   -   c o l u m n s . d u r a t i o n _ w   -   c o v e r . m a r g i n ; 
 
                         / / 
 
                         i f ( c o l u m n s . r a t i n g _ w < = 0 )   { 
 
                                 i f ( g _ f o n t _ g u i f x _ f o u n d )   { 
 
                                         c o l u m n s . r a t i n g _ w   =   g r . C a l c T e x t W i d t h ( " b b b b b " ,   r a t i n g _ f o n t ) ; 
 
                                 }   e l s e   { 
 
                                         c o l u m n s . r a t i n g _ w   =   g r . C a l c T e x t W i d t h ( " * * * * * " ,   r a t i n g _ f o n t ) ; 
 
                                 } ; 
 
                         } ; 
 
                         c o l u m n s . r a t i n g _ x   =   c o l u m n s . d u r a t i o n _ x   -   ( c o l u m n s . r a t i n g _ w * c o l u m n s . r a t i n g ) ; 
 
                         / / 
 
                         i f ( c o l u m n s . m o o d _ w < = 0 )   { 
 
                                 i f ( g _ f o n t _ g u i f x _ f o u n d )   { 
 
                                         c o l u m n s . m o o d _ w   =   g r . C a l c T e x t W i d t h ( " v " ,   m o o d _ f o n t )   +   3 ; 
 
                                 }   e l s e   { 
 
                                         c o l u m n s . m o o d _ w   =   g r . C a l c T e x t W i d t h ( " e&" ,   m o o d _ f o n t )   +   3 ; 
 
                                 } ; 
 
                         } ; 
 
                         c o l u m n s . m o o d _ x   =   c o l u m n s . r a t i n g _ x   -   ( c o l u m n s . m o o d _ w * c o l u m n s . m o o d ) ; 
 
                         / / 
 
                         i f ( c o l u m n s . b i t r a t e _ w < = 0 )   { 
 
                                 c o l u m n s . b i t r a t e _ w   =   g r . C a l c T e x t W i d t h ( " X X X X X X X " ,   g _ f o n t ) * c o l u m n s . b i t r a t e ; 
 
                         } ; 
 
                         c o l u m n s . b i t r a t e _ x   =   c o l u m n s . m o o d _ x   -   ( c o l u m n s . b i t r a t e _ w * c o l u m n s . b i t r a t e ) ; 
 
                         / / 
 
                         i f ( c o l u m n s . p l a y c o u n t   & &   t h i s . p l a y c o u n t > 0 )   { 
 
                                 v a r   p l a y c o u n t _ w   =   g r . C a l c T e x t W i d t h ( t h i s . p l a y c o u n t ,   m i n i _ f o n t ) + 3 ; 
 
                         }   e l s e   { 
 
                                 v a r   p l a y c o u n t _ w   =   0 ; 
 
                         } ; 
 
                         / / 
 
                         c o l u m n s . t i t l e _ x   =   c o l u m n s . t r a c k n u m b e r _ x   +   c o l u m n s . t r a c k n u m b e r _ w ; 
 
                         c o l u m n s . t i t l e _ w   =   ( c o l u m n s . r a t i n g _ x   -   c o l u m n s . t i t l e _ x   -   3   -   p l a y c o u n t _ w )   -   ( c o l u m n s . b i t r a t e _ w * c o l u m n s . b i t r a t e )   -   ( c o l u m n s . m o o d _ w * c o l u m n s . m o o d ) ; 
 
                         / /   * * * * * * * * * * * * * * * * * * * * * * * * * * 
 
                         / /   . e n d .   * * *   c o l s   m e t r i c s   * * * 
 
                         / /   * * * * * * * * * * * * * * * * * * * * * * * * * * 
 
                         
 
                         r o w . p a r i t y   =   ( r o w . h / 2 = = M a t h . f l o o r ( r o w . h ) ) ? 1 : 0 ; 
 
                         
 
                         / /   n o w   p l a y i n g   i n f o   :   P l a y   i c o n   +   P r o g r e s s   b a r 
 
                         v a r   d u r a t i o n   =   t h i s . d u r a t i o n ; 
 
                         v a r   b i t r a t e   =   t h i s . b i t r a t e ; 
 
                         i f ( p l m a n . P l a y i n g P l a y l i s t   = =   p l m a n . A c t i v e P l a y l i s t )   { 
 
                                 i f ( f b . I s P l a y i n g )   { 
 
                                         l i s t . n o w p l a y i n g   =   p l m a n . G e t P l a y i n g I t e m L o c a t i o n ( ) ; 
 
                                         i f ( t h i s . i d = = l i s t . n o w p l a y i n g . P l a y l i s t I t e m I n d e x )   { 
 
                                                 v a r   i s p l a y i n g   =   t r u e ; 
 
                                                 g _ p l a y i n g _ i t e m _ y   =   t h i s . y ; 
 
                                                 / /   p r o g r e s s   b a r   ( i f   n o t   a   s t r e a m ! ) 
 
                                                 i f ( t h i s . t r a c k _ t y p e ! = 3   & &   r o w . s h o w _ p r o g r e s s   & &   f b . P l a y b a c k L e n g t h )   { 
 
                                                         v a r   l e n g t h _ s e c o n d s   =   t f _ l e n g t h _ s e c o n d s . E v a l W i t h M e t a d b ( t h i s . m e t a d b ) ; 
 
                                                         v a r   p r o g r e s s   =   M a t h . r o u n d ( g _ s e c o n d s   /   l e n g t h _ s e c o n d s   *   ( w w - v s c r o l l b a r . w - t h i s . x - 2 ) ) ; 
 
                                                         g r . F i l l G r a d R e c t ( t h i s . x + 1 ,   t h i s . y ,   p r o g r e s s ,   t h i s . h ,   9 0 ,   p p t . p r o g r e s s _ b a r _ c o l o r _ c u s t o m   = =   t r u e   ?   ( p p t . p r o g r e s s _ b a r _ c o l o r & R G B A ( 2 5 5 , 2 5 5 , 2 5 5 , p p t . p r o g r e s s _ b a r _ a l p h a ) )   :   ( g _ t e x t c o l o r _ s e l & R G B A ( 2 5 5 , 2 5 5 , 2 5 5 , p p t . p r o g r e s s _ b a r _ a l p h a ) )   ,   0 ,   0 . 5 ) ;   / / 0 x 8 0 f f f f f f   g _ t e x t c o l o r _ s e l 
 
                                                 } ; 
 
                                                 / /   c a l c   d y n a m i c   o t h e r   t f   v a l u e s   - - -   p l a y i c o n 
 
                                                 d u r a t i o n   =   t f _ p l a y b a c k _ t i m e _ r e m a i n i n g . E v a l ( t r u e ) ; 
 
                                                 b i t r a t e   =   t f _ b i t r a t e _ p l a y i n g . E v a l ( t r u e ) ; 
 
                                                 i f ( c o l u m n s . p l a y i c o n )   { 
 
                                                         i f ( g _ s e c o n d s / 2 = = M a t h . f l o o r ( g _ s e c o n d s / 2 ) )   { 
 
                                                                 g r . D r a w I m a g e ( p l a y i c o n _ o f f ,   c o l u m n s . p l a y i c o n _ x + 6 ,   t h i s . y ,   p l a y i c o n _ o f f . W i d t h ,   p l a y i c o n _ o f f . H e i g h t ,   0 ,   0 ,   p l a y i c o n _ o f f . W i d t h ,   p l a y i c o n _ o f f . H e i g h t ,   0 ,   2 5 5 ) ; 
 
                                                         }   e l s e   { 
 
                                                                 g r . D r a w I m a g e ( p l a y i c o n _ o n ,   c o l u m n s . p l a y i c o n _ x + 6 ,   t h i s . y ,   p l a y i c o n _ o f f . W i d t h ,   p l a y i c o n _ o f f . H e i g h t ,   0 ,   0 ,   p l a y i c o n _ o f f . W i d t h ,   p l a y i c o n _ o f f . H e i g h t ,   0 ,   2 5 5 ) ; 
 
                                                         } ; 
 
                                                 } ; 
 
                                         }   e l s e   { 
 
                                                 v a r   i s p l a y i n g   =   f a l s e ; 
 
                                         } ; 
 
                                 } ; 
 
                         } ; 
 
                         / /   d r a w   t r a c k n u m b e r 
 
                         i f ( c o l u m n s . t r a c k n u m b e r )   { 
 
                                 i f ( p l m a n . I s P l a y b a c k Q u e u e A c t i v e ( ) )   { 
 
                                         v a r   q u e u e _ i n d e x   =   p l m a n . F i n d P l a y b a c k Q u e u e I t e m I n d e x ( t h i s . m e t a d b ,   p l m a n . A c t i v e P l a y l i s t ,   t h i s . i d ) ; 
 
                                 } ; 
 
                                 i f ( s t a t e = = 0 )   { 
 
                                         i f ( q u e u e _ i n d e x > = 0 )   { 
 
                                                 g r . F i l l G r a d R e c t ( c o l u m n s . t r a c k n u m b e r _ x + 3 ,   t h i s . y + 3 ,   c o l u m n s . t r a c k n u m b e r _ w - 7 ,   t h i s . h - 6 ,   9 0 ,   g _ b a c k c o l o r & 0 x 1 5 f f f f f f ,   R G B A ( 1 0 0 , 1 8 0 , 1 0 0 , 7 0 ) ,   1 . 0 ) ; 
 
                                                 g r . D r a w R e c t ( c o l u m n s . t r a c k n u m b e r _ x + 3 ,   t h i s . y + 3 ,   c o l u m n s . t r a c k n u m b e r _ w - 8 ,   t h i s . h - 7 ,   1 . 0 ,   R G B A ( 1 0 0 , 1 8 0 , 1 0 0 , 4 0 ) ) ; 
 
                                         }   e l s e   { 
 
                                                 i f ( i s Q u e u e P l a y l i s t A c t i v e ( ) )   { 
 
                                                         g r . F i l l G r a d R e c t ( c o l u m n s . t r a c k n u m b e r _ x + 3 ,   t h i s . y + 3 ,   c o l u m n s . t r a c k n u m b e r _ w - 7 ,   t h i s . h - 6 ,   9 0 ,   g _ b a c k c o l o r & 0 x 1 5 f f f f f f ,   R G B A ( 1 0 0 , 1 8 0 , 1 0 0 , 7 0 ) ,   1 . 0 ) ; 
 
                                                         g r . D r a w R e c t ( c o l u m n s . t r a c k n u m b e r _ x + 3 ,   t h i s . y + 3 ,   c o l u m n s . t r a c k n u m b e r _ w - 8 ,   t h i s . h - 7 ,   1 . 0 ,   R G B A ( 1 0 0 , 1 8 0 , 1 0 0 , 4 0 ) ) ; 
 
                                                 }   e l s e   { 
 
                                                         g r . F i l l G r a d R e c t ( c o l u m n s . t r a c k n u m b e r _ x + 3 ,   t h i s . y + 3 ,   c o l u m n s . t r a c k n u m b e r _ w - 7 ,   t h i s . h - 6 ,   9 0 ,   p p t . t r _ n u m b e r _ g r a d _ c o l o r _ 1 & R G B A ( 2 5 5 , 2 5 5 , 2 5 5 , p p t . t r _ n u m b e r _ g r a d _ c o l o r _ 1 _ a l p h a ) ,   p p t . t r _ n u m b e r _ g r a d _ c o l o r _ 2 & R G B A ( 2 5 5 , 2 5 5 , 2 5 5 , p p t . t r _ n u m b e r _ g r a d _ c o l o r _ 2 _ a l p h a ) ,   1 . 0 ) ;   / / g _ b a c k c o l o r & 0 x 1 5 f f f f f f ,   g _ t e x t c o l o r & 0 x 1 5 f f f f f f 
 
                                                         g r . D r a w R e c t ( c o l u m n s . t r a c k n u m b e r _ x + 3 ,   t h i s . y + 3 ,   c o l u m n s . t r a c k n u m b e r _ w - 8 ,   t h i s . h - 7 ,   1 . 0 ,   p p t . t r _ n u m b e r _ r e c t _ c o l o r & R G B A ( 2 5 5 , 2 5 5 , 2 5 5 , p p t . t r _ n u m b e r _ r e c t _ c o l o r _ a l p h a ) ) ;   / / g _ t e x t c o l o r & 0 x 1 0 f f f f f f 
 
                                                 } ; 
 
                                         } ; 
 
                                 } 
 
                                 / / v a r   n e w _ t r a c k n u m b e r   =   ( t h i s . t r a c k n u m b e r > 0 ) ?   t h i s . t r a c k n u m b e r   :   ( g r o u p . n b r o w s > 0 ? n u m ( t h i s . g r p _ i d x + 1 , 2 ) : " ? " ) ; 
 
                                 v a r   n e w _ t r a c k n u m b e r   =   ( q u e u e _ i n d e x > = 0 )   ?   "   "   +   n u m ( q u e u e _ i n d e x + 1 , 2 )   +   " * "   :   ( ( t h i s . t r a c k n u m b e r > 0 ) ?   t h i s . t r a c k n u m b e r   :   n u m ( t h i s . g r p _ i d x + 1 , 2 ) ) ; 
 
                                 t r y   { 
 
                                         / / g r . G d i D r a w T e x t ( n e w _ t r a c k n u m b e r ,   g _ f o n t ,   ( q u e u e _ i n d e x > = 0   | |   i s Q u e u e P l a y l i s t A c t i v e ( ) ) ? R G B ( 1 0 0 , 1 8 0 , 1 0 0 ) : ( i s p l a y i n g ? g _ t e x t c o l o r _ s e l : g _ t e x t c o l o r ) ,   c o l u m n s . t r a c k n u m b e r _ x ,   t h i s . y ,   c o l u m n s . t r a c k n u m b e r _ w ,   t h i s . h - r o w . p a r i t y ,   D T _ C E N T E R   |   D T _ C A L C R E C T   |   D T _ V C E N T E R   |   D T _ E N D _ E L L I P S I S   |   D T _ N O P R E F I X ) ; 
 
                                         g r . G d i D r a w T e x t ( n e w _ t r a c k n u m b e r ,   g _ f o n t ,   ( q u e u e _ i n d e x > = 0   | |   i s Q u e u e P l a y l i s t A c t i v e ( ) ) ? R G B ( 1 0 0 , 1 8 0 , 1 0 0 ) : ( i s p l a y i n g ? p p t . t r _ n u m b e r _ t e x t _ c o l o r _ 1 : p p t . t r _ n u m b e r _ t e x t _ c o l o r _ 2 ) ,   c o l u m n s . t r a c k n u m b e r _ x ,   t h i s . y ,   c o l u m n s . t r a c k n u m b e r _ w ,   t h i s . h - r o w . p a r i t y ,   D T _ C E N T E R   |   D T _ C A L C R E C T   |   D T _ V C E N T E R   |   D T _ E N D _ E L L I P S I S   |   D T _ N O P R E F I X ) ; 
 
                                 }   c a t c h ( e )   { 
 
                                         g r . G d i D r a w T e x t ( n e w _ t r a c k n u m b e r ,   g d i . F o n t ( " t a h o m a " ,   1 1 ) ,   ( q u e u e _ i n d e x > = 0   | |   i s Q u e u e P l a y l i s t A c t i v e ( ) ) ? R G B ( 1 0 0 , 1 8 0 , 1 0 0 ) : ( i s p l a y i n g ? g _ t e x t c o l o r _ s e l : g _ t e x t c o l o r ) ,   c o l u m n s . t r a c k n u m b e r _ x ,   t h i s . y ,   c o l u m n s . t r a c k n u m b e r _ w ,   t h i s . h - r o w . p a r i t y ,   D T _ C E N T E R   |   D T _ C A L C R E C T   |   D T _ V C E N T E R   |   D T _ E N D _ E L L I P S I S   |   D T _ N O P R E F I X ) ; 
 
                                 } ; 
 
                         } ; 
 
 
 
                         / /   d r a w   t i t l e 
 
                         t r y   { 
 
                                 t f _ t i t l e _ w   =   g r . C a l c T e x t W i d t h ( t h i s . t i t l e ,   g _ f o n t ) ; 
 
                                 i f ( t f _ t i t l e _ w   >   c o l u m n s . t i t l e _ w )   { 
 
                                         t f _ t i t l e _ w   =   c o l u m n s . t i t l e _ w ; 
 
                                         t h i s . t o o l t i p   =   f a l s e ; 
 
                                 } ; 
 
                                 g r . G d i D r a w T e x t ( t h i s . t i t l e ,   g _ f o n t ,   i s p l a y i n g ? g _ t e x t c o l o r _ s e l : g _ t e x t c o l o r ,   c o l u m n s . t i t l e _ x ,   t h i s . y ,   c o l u m n s . t i t l e _ w ,   t h i s . h - r o w . p a r i t y ,   D T _ L E F T   |   D T _ C A L C R E C T   |   D T _ V C E N T E R   |   D T _ E N D _ E L L I P S I S   |   D T _ N O P R E F I X ) ; 
 
                         }   c a t c h ( e )   { 
 
                                 t f _ t i t l e _ w   =   g r . C a l c T e x t W i d t h ( t h i s . t i t l e ,   g d i . F o n t ( " t a h o m a " ,   1 1 ) ) ; 
 
                                 i f ( t f _ t i t l e _ w   >   c o l u m n s . t i t l e _ w )   { 
 
                                         t f _ t i t l e _ w   =   c o l u m n s . t i t l e _ w ; 
 
                                         t h i s . t o o l t i p   =   f a l s e ; 
 
                                 } ; 
 
                                 g r . G d i D r a w T e x t ( t h i s . t i t l e ,   g d i . F o n t ( " t a h o m a " ,   1 1 ) ,   i s p l a y i n g ? g _ t e x t c o l o r _ s e l : g _ t e x t c o l o r ,   c o l u m n s . t i t l e _ x ,   t h i s . y ,   c o l u m n s . t i t l e _ w ,   t h i s . h - r o w . p a r i t y ,   D T _ L E F T   |   D T _ C A L C R E C T   |   D T _ V C E N T E R   |   D T _ E N D _ E L L I P S I S   |   D T _ N O P R E F I X ) ; 
 
                         } ; 
 
                         
 
                         / /   d r a w   a r t i s t 
 
                         i f ( g r o u p . n b r o w s = = 0   | |   ( c o l u m n s . t i t l e = = 1   & &   t h i s . a r t i s t ! = t h i s . a l b u m a r t i s t )   | |   c o l u m n s . t i t l e = = 2 )   { 
 
                                 v a r   a r t i s t _ x   =   c o l u m n s . t i t l e _ x   +   t f _ t i t l e _ w ; 
 
                                 t r y   { 
 
                                         v a r   a r t i s t _ w   =   c o l u m n s . t i t l e _ w   -   t f _ t i t l e _ w ; 
 
                                         t f _ a r t i s t _ w   =   g r . C a l c T e x t W i d t h ( "   " + p a n e l . t a g _ s e p a r a t o r + "   " + t h i s . a r t i s t ,   g _ f o n t ) ; 
 
                                         i f ( t f _ a r t i s t _ w   >   a r t i s t _ w )   { 
 
                                                 t f _ a r t i s t _ w   =   a r t i s t _ w ; 
 
                                                 t h i s . t o o l t i p   =   f a l s e ; 
 
                                         } ; 
 
                                         i f ( t f _ t i t l e _ w   <   c o l u m n s . t i t l e _ w )   { 
 
                                                 g r . G d i D r a w T e x t ( "   " + p a n e l . t a g _ s e p a r a t o r + "   " + t h i s . a r t i s t ,   g _ f o n t ,   g _ t e x t c o l o r _ h l ,   a r t i s t _ x ,   t h i s . y ,   a r t i s t _ w ,   t h i s . h - r o w . p a r i t y ,   D T _ L E F T   |   D T _ C A L C R E C T   |   D T _ V C E N T E R   |   D T _ E N D _ E L L I P S I S   |   D T _ N O P R E F I X ) ; 
 
                                         } ; 
 
                                 }   c a t c h ( e )   { 
 
                                         v a r   a r t i s t _ w   =   c o l u m n s . t i t l e _ w   -   t f _ t i t l e _ w ; 
 
                                         t f _ a r t i s t _ w   =   g r . C a l c T e x t W i d t h ( "   " + p a n e l . t a g _ s e p a r a t o r + "   " + t h i s . a r t i s t ,   g d i . F o n t ( " t a h o m a " ,   1 1 ) ) ; 
 
                                         i f ( t f _ a r t i s t _ w   >   a r t i s t _ w )   { 
 
                                                 t f _ a r t i s t _ w   =   a r t i s t _ w ; 
 
                                                 t h i s . t o o l t i p   =   f a l s e ; 
 
                                         } ; 
 
                                         i f ( t f _ t i t l e _ w   <   c o l u m n s . t i t l e _ w )   { 
 
                                                 g r . G d i D r a w T e x t ( "   " + p a n e l . t a g _ s e p a r a t o r + "   " + t h i s . a r t i s t ,   g d i . F o n t ( " t a h o m a " ,   1 1 ) ,   g _ t e x t c o l o r _ h l ,   a r t i s t _ x ,   t h i s . y ,   a r t i s t _ w ,   t h i s . h - r o w . p a r i t y ,   D T _ L E F T   |   D T _ C A L C R E C T   |   D T _ V C E N T E R   |   D T _ E N D _ E L L I P S I S   |   D T _ N O P R E F I X ) ; 
 
                                         } ; 
 
                                 } ; 
 
                         }   e l s e   { 
 
                                 i f ( t f _ t i t l e _ w   >   c o l u m n s . t i t l e _ w )   t h i s . t o o l t i p   =   t r u e ; 
 
                                 t f _ a r t i s t _ w   =   0 ; 
 
                         } ; 
 
                         
 
                         / /   d r a w   p l a y c o u n t 
 
                         i f ( c o l u m n s . p l a y c o u n t   & &   p l a y c o u n t _ w > 0 )   { 
 
                                 v a r   p l a y c o u n t _ x   =   c o l u m n s . t i t l e _ x   +   t f _ t i t l e _ w   +   t f _ a r t i s t _ w ; 
 
                                 t r y   { 
 
                                         g r . D r a w S t r i n g ( t h i s . p l a y c o u n t ,   m i n i _ f o n t ,   p p t . e x t r a _ g r o u p _ i n f o s _ c o l o r & R G B A ( 2 5 5 , 2 5 5 , 2 5 5 , p p t . e x t r a _ g r o u p _ i n f o s _ c o l o r _ a l p h a ) ,   p l a y c o u n t _ x ,   t h i s . y - 4 ,   p l a y c o u n t _ w ,   t h i s . h - r o w . p a r i t y ,   r c _ s t r i n g f o r m a t ) ; 
 
                                 }   c a t c h ( e )   { 
 
                                         g r . D r a w S t r i n g ( t h i s . p l a y c o u n t ,   g d i . F o n t ( " t a h o m a " ,   8 ) ,   g _ t e x t c o l o r & 0 x 4 0 f f f f f f ,   p l a y c o u n t _ x ,   t h i s . y - 4 ,   p l a y c o u n t _ w ,   t h i s . h - r o w . p a r i t y ,   r c _ s t r i n g f o r m a t ) ; 
 
                                 } ; 
 
                         } ; 
 
                         
 
                         / /   d r a w   r a t i n g 
 
                         i f ( c o l u m n s . r a t i n g )   { 
 
                                 / /   R a t i n g   e n g i n e 
 
                                 i f ( t h i s . r a t i n g _ h o v e r )   { 
 
                                         f o r   ( v a r   i   =   1 ;   i   <   6 ;   i + + ) { 
 
                                                 i f ( t h i s . t r a c k _ t y p e < 2 ) { 
 
                                                         v a r   r _ c o l o r   =   ( i   >   ( t h i s . r a t i n g _ h o v e r   ?   t h i s . l _ r a t i n g   :   t h i s . r a t i n g ) )   ?   g _ t e x t c o l o r & 0 x 1 2 f f f f f f   :   ( t h i s . r a t i n g _ h o v e r   ?   ( i = = t h i s . r a t i n g   ?   ( i = = t h i s . l _ r a t i n g   ?   R G B ( 2 5 5 , 5 0 , 5 0 )   :   g _ t e x t c o l o r _ s e l )   :   g _ t e x t c o l o r _ s e l )   :   g _ t e x t c o l o r & 0 x 9 0 f f f f f f ) ; 
 
                                                         i f ( t h i s . r a t i n g _ h o v e r   & &   t h i s . l _ r a t i n g = = t h i s . r a t i n g )   { 
 
                                                                 r _ c o l o r   =   i < = t h i s . l _ r a t i n g   ?   R G B ( 2 5 5 , 5 0 , 5 0 )   :   g _ t e x t c o l o r & 0 x 1 2 f f f f f f ; 
 
                                                         } 
 
                                                 }   e l s e   { 
 
                                                         v a r   r _ c o l o r   =   g _ t e x t c o l o r & 0 x 1 2 f f f f f f ; 
 
                                                 } ; 
 
                                                 i f ( g _ f o n t _ g u i f x _ f o u n d )   { 
 
                                                         g r . S e t T e x t R e n d e r i n g H i n t ( 5 ) ; 
 
                                                         i f ( r _ c o l o r = = R G B ( 2 5 5 , 5 0 , 5 0 ) ) { 
 
                                                                 g r . D r a w S t r i n g ( " x " ,   d e l _ r a t i n g _ f o n t ,   r _ c o l o r ,   c o l u m n s . r a t i n g _ x + 1 4 * ( i - 1 ) + 1 ,   t h i s . y - 1 ,   1 4 ,   r o w . h ,   l c _ s t r i n g f o r m a t ) ; 
 
                                                         }   e l s e   { 
 
                                                                 g r . D r a w S t r i n g ( " b " ,   r a t i n g _ f o n t ,   r _ c o l o r ,   c o l u m n s . r a t i n g _ x + 1 4 * ( i - 1 ) ,   t h i s . y ,   1 4 ,   r o w . h ,   l c _ s t r i n g f o r m a t ) ; 
 
                                                         } ; 
 
                                                 }   e l s e   { 
 
                                                         g r . S e t T e x t R e n d e r i n g H i n t ( 3 ) ; 
 
                                                         g r . D r a w S t r i n g ( " * " ,   r a t i n g _ f o n t ,   r _ c o l o r ,   c o l u m n s . r a t i n g _ x + 1 2 * ( i - 1 ) ,   t h i s . y + 4 ,   1 2 ,   r o w . h ,   l c _ s t r i n g f o r m a t ) ; 
 
                                                 } ; 
 
                                         } ; 
 
                                 }   e l s e   { 
 
                                         i f ( g _ f o n t _ g u i f x _ f o u n d )   { 
 
                                                 g r . S e t T e x t R e n d e r i n g H i n t ( 5 ) ; 
 
                                                 g r . D r a w S t r i n g ( " b b b b b " ,   r a t i n g _ f o n t ,   g _ t e x t c o l o r & 0 x 1 2 f f f f f f ,   c o l u m n s . r a t i n g _ x ,   t h i s . y - 1 ,   c o l u m n s . r a t i n g _ w + 1 ,   r o w . h ,   l c _ s t r i n g f o r m a t ) ; 
 
                                                 g r . D r a w S t r i n g ( " b " . r e p e a t ( M a t h . r o u n d ( t h i s . r a t i n g ) ) ,   r a t i n g _ f o n t ,   g _ t e x t c o l o r & 0 x 9 0 f f f f f f ,   c o l u m n s . r a t i n g _ x ,   t h i s . y - 1 ,   c o l u m n s . r a t i n g _ w + 1 ,   r o w . h ,   l c _ s t r i n g f o r m a t ) ; 
 
                                         }   e l s e   { 
 
                                                 g r . S e t T e x t R e n d e r i n g H i n t ( 3 ) ; 
 
                                                 g r . D r a w S t r i n g ( " * * * * * " ,   r a t i n g _ f o n t ,   g _ t e x t c o l o r & 0 x 1 2 f f f f f f ,   c o l u m n s . r a t i n g _ x ,   t h i s . y + 4 ,   c o l u m n s . r a t i n g _ w + 1 ,   r o w . h ,   l c _ s t r i n g f o r m a t ) ; 
 
                                                 g r . D r a w S t r i n g ( " * " . r e p e a t ( M a t h . r o u n d ( t h i s . r a t i n g ) ) ,   r a t i n g _ f o n t ,   g _ t e x t c o l o r & 0 x 9 0 f f f f f f ,   c o l u m n s . r a t i n g _ x ,   t h i s . y + 4 ,   c o l u m n s . r a t i n g _ w + 1 ,   r o w . h ,   l c _ s t r i n g f o r m a t ) ; 
 
                                         } ; 
 
                                 } ; 
 
                         } ; 
 
 
 
                         / /   d r a w   b i t r a t e 
 
                         i f ( c o l u m n s . b i t r a t e )   { 
 
                                 t r y   { 
 
                                         g r . G d i D r a w T e x t ( b i t r a t e ,   g _ f o n t ,   i s p l a y i n g ? g _ t e x t c o l o r _ s e l : g _ t e x t c o l o r ,   c o l u m n s . b i t r a t e _ x ,   t h i s . y ,   c o l u m n s . b i t r a t e _ w ,   t h i s . h - r o w . p a r i t y ,   D T _ C E N T E R   |   D T _ C A L C R E C T   |   D T _ V C E N T E R   |   D T _ E N D _ E L L I P S I S   |   D T _ N O P R E F I X ) ; 
 
                                 }   c a t c h ( e )   { 
 
                                         g r . G d i D r a w T e x t ( b i t r a t e ,   g d i . F o n t ( " t a h o m a " ,   1 1 ) ,   i s p l a y i n g ? g _ t e x t c o l o r _ s e l : g _ t e x t c o l o r ,   c o l u m n s . b i t r a t e _ x ,   t h i s . y ,   c o l u m n s . b i t r a t e _ w ,   t h i s . h - r o w . p a r i t y ,   D T _ C E N T E R   |   D T _ C A L C R E C T   |   D T _ V C E N T E R   |   D T _ E N D _ E L L I P S I S   |   D T _ N O P R E F I X ) ; 
 
                                 } ; 
 
                         } ; 
 
                         
 
                         / /   d r a w   M o o d   i c o n 
 
                         i f ( c o l u m n s . m o o d )   { 
 
                                 i f ( t h i s . t r a c k _ t y p e < 2 ) { 
 
                                         r _ c o l o r   =   t h i s . m o o d _ h o v e r   ?   g _ t e x t c o l o r _ s e l   :   ( t h i s . m o o d ! = 0   ?   R G B ( 2 5 5 , 8 0 , 1 2 0 )   :   g _ t e x t c o l o r & 0 x 5 0 f f f f f f ) ; 
 
                                 }   e l s e   { 
 
                                         v a r   r _ c o l o r   =   g _ t e x t c o l o r & 0 x 1 2 f f f f f f ; 
 
                                 } ; 
 
                                 i f ( g _ f o n t _ g u i f x _ f o u n d )   { 
 
                                         g r . S e t T e x t R e n d e r i n g H i n t ( 4 ) ; 
 
                                         g r . D r a w S t r i n g ( " v " ,   m o o d _ f o n t ,   r _ c o l o r ,   c o l u m n s . m o o d _ x ,   t h i s . y + 1 ,   c o l u m n s . m o o d _ w ,   r o w . h ,   l c _ s t r i n g f o r m a t ) ; 
 
                                 }   e l s e   { 
 
                                         g r . S e t T e x t R e n d e r i n g H i n t ( 4 ) ; 
 
                                         g r . D r a w S t r i n g ( " e&" ,   m o o d _ f o n t ,   r _ c o l o r ,   c o l u m n s . m o o d _ x ,   t h i s . y ,   c o l u m n s . m o o d _ w ,   r o w . h ,   l c _ s t r i n g f o r m a t ) ; 
 
                                 } ; 
 
 
 
                         } ; 
 
                         
 
                         / /   d r a w   p l a y b a c k t i m e / d u r a t i o n 
 
                         t r y   { 
 
                                 g r . G d i D r a w T e x t ( d u r a t i o n ,   g _ f o n t ,   i s p l a y i n g ? g _ t e x t c o l o r _ s e l : g _ t e x t c o l o r ,   c o l u m n s . d u r a t i o n _ x ,   t h i s . y ,   c o l u m n s . d u r a t i o n _ w ,   t h i s . h - r o w . p a r i t y ,   D T _ R I G H T   |   D T _ C A L C R E C T   |   D T _ V C E N T E R   |   D T _ E N D _ E L L I P S I S   |   D T _ N O P R E F I X ) ; 
 
                         }   c a t c h ( e )   { 
 
                                 g r . G d i D r a w T e x t ( d u r a t i o n ,   g d i . F o n t ( " t a h o m a " ,   1 1 ) ,   i s p l a y i n g ? g _ t e x t c o l o r _ s e l : g _ t e x t c o l o r ,   c o l u m n s . d u r a t i o n _ x ,   t h i s . y ,   c o l u m n s . d u r a t i o n _ w ,   t h i s . h - r o w . p a r i t y ,   D T _ R I G H T   |   D T _ C A L C R E C T   |   D T _ V C E N T E R   |   D T _ E N D _ E L L I P S I S   |   D T _ N O P R E F I X ) ; 
 
                         } ; 
 
                         
 
                         / /   i f   d r a g g i n g   i t e m s ,   d r a w   l i n e   a t   t o p   o f   t h e   h o v e r   i t e m s   t o   s h o w   w h e r e   d r a g g e d   i t e m s   w i l l   b e   i n s e r t e d   o n   m o u s e   b u t t o n   u p 
 
                         / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 
 
                         i f ( ! p p t . t o u c h _ o n   & &   d r a g n d r o p . d r a g _ i n   & &   t h i s . i s h o v e r   & &   p a n e l . i s h o v e r )   { 
 
                                 i f ( ! p l m a n . I s P l a y l i s t I t e m S e l e c t e d ( p l m a n . A c t i v e P l a y l i s t ,   t h i s . i d ) )   { 
 
                                         i f ( t h i s . i d > d r a g n d r o p . d r a g _ i d )   { 
 
                                                 g r . D r a w L i n e ( t h i s . x + 5 ,   t h i s . y + t h i s . h ,   w w - v s c r o l l b a r . w - 5 ,   t h i s . y + t h i s . h ,   2 . 0 ,   g _ t e x t c o l o r ) ; 
 
                                                 g r . D r a w I m a g e ( i c o n _ a r r o w _ l e f t ,   t h i s . x ,   t h i s . y + t h i s . h - 4 ,   8 ,   8 ,   0 ,   0 ,   8 ,   8 ,   0 ,   2 5 5 ) ; 
 
                                                 g r . D r a w I m a g e ( i c o n _ a r r o w _ l e f t ,   t h i s . x + w w - v s c r o l l b a r . w ,   t h i s . y + t h i s . h - 4 ,   - 8 ,   8 ,   0 ,   0 ,   8 ,   8 ,   0 ,   2 5 5 ) ; 
 
                                                 d r a g n d r o p . d r o p _ i d   =   t h i s . i d ; 
 
                                         }   e l s e   i f ( t h i s . i d < d r a g n d r o p . d r a g _ i d )   { 
 
                                                 g r . D r a w L i n e ( t h i s . x + 5 ,   t h i s . y ,   w w - v s c r o l l b a r . w - 5 ,   t h i s . y ,   2 . 0 ,   g _ t e x t c o l o r ) ; 
 
                                                 g r . D r a w I m a g e ( i c o n _ a r r o w _ l e f t ,   t h i s . x ,   t h i s . y - 4 ,   8 ,   8 ,   0 ,   0 ,   8 ,   8 ,   0 ,   2 5 5 ) ; 
 
                                                 g r . D r a w I m a g e ( i c o n _ a r r o w _ l e f t ,   t h i s . x + w w - v s c r o l l b a r . w ,   t h i s . y - 4 ,   - 8 ,   8 ,   0 ,   0 ,   8 ,   8 ,   0 ,   2 5 5 ) ; 
 
                                                 d r a g n d r o p . d r o p _ i d   =   t h i s . i d ; 
 
                                         } ; 
 
                                 } ; 
 
                         } ; 
 
                         / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 
 
                 }   e l s e   i f ( t h i s . g r i d x = = g r o u p . n b r o w s   & &   g r o u p . n b r o w s > 0 )   { 
 
                         / /   - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   : : :   D r a w   g r o u p   H e a d e r 
 
                         / /   - - - - - - - - - - - - - - - - - - - - - 
 
                         
 
                         / /   t o t a l   i t e m s   i n   t h e   g r o u p 
 
                         v a r   t o t a l _ g r p _ i t e m s   =   l i s t . g r o u p s [ l i s t . h l i s t [ t h i s . i d ] - 1 ] ; 
 
                         
 
                         / /   b a c k g r o u n d 
 
                         i f ( g r o u p . n b r o w s > 1   & &   g r o u p . t y p e = = 0 )   {     / /   d i s p l a y   t h e   y e a r   o n l y   i f   g r o u p   b y   a l b u m   ( g r o u p . t y p e   =   0 ) 
 
                                 v a r   d a t e _ s t r   =   g r . M e a s u r e S t r i n g ( t h i s . d a t e ,   g h _ d a t e _ f o n t ,   0 ,   0 ,   2 0 0 ,   3 0 ,   0 ) ; 
 
                                 v a r   y e a r _ x   =   w w - v s c r o l l b a r . w - d a t e _ s t r . W i d t h - c o v e r . m a r g i n ; 
 
                                 v a r   y e a r _ w   =   ( g r o u p . n b r o w s > 1   & &   ( t h i s . a l b u m . l e n g t h > 0   | |   t o t a l _ g r p _ i t e m s = = 1 )   & &   t h i s . d a t e ) ? d a t e _ s t r . W i d t h + c o v e r . m a r g i n * 2 : 0 ; 
 
                         }   e l s e   { 
 
                                 v a r   y e a r _ x   =   0 ; 
 
                                 v a r   y e a r _ w   =   0 ; 
 
                         } ; 
 
                         g r . F i l l G r a d R e c t ( t h i s . x ,   t h i s . y - ( ( g r o u p . n b r o w s - 1 ) * r o w . h ) ,   t h i s . w - v s c r o l l b a r . w - y e a r _ w ,   g r o u p . n b r o w s * r o w . h ,   9 0 ,   R G B A ( 2 5 5 , 2 5 5 , 2 5 5 , 1 5 ) ,   R G B A ( 0 , 0 , 0 , 1 5 ) ,   1 . 0 ) ; 
 
                         / / 
 
                         g r . F i l l G r a d R e c t ( t h i s . x - 3 0 ,   t h i s . y - ( ( g r o u p . n b r o w s - 1 ) * r o w . h ) ,   t h i s . w - v s c r o l l b a r . w + 6 0 ,   1 ,   0 ,   0 ,   R G B A ( 0 , 0 , 0 , 1 5 ) ,   0 . 5 ) ; 
 
                         g r . F i l l S o l i d R e c t ( t h i s . x ,   t h i s . y - ( ( g r o u p . n b r o w s - 1 ) * r o w . h ) + 1 ,   t h i s . w - v s c r o l l b a r . w ,   1 ,   R G B A ( 2 5 5 , 2 5 5 , 2 5 5 , 1 5 ) ) ; 
 
                         g r . F i l l S o l i d R e c t ( t h i s . x ,   t h i s . y + r o w . h - 0 ,   t h i s . w - v s c r o l l b a r . w ,   1 ,   R G B A ( 2 5 5 , 2 5 5 , 2 5 5 , 5 ) ) ; 
 
                         g r . F i l l S o l i d R e c t ( t h i s . x ,   t h i s . y + r o w . h - 1 ,   t h i s . w - v s c r o l l b a r . w ,   1 ,   R G B A ( 0 , 0 , 0 , 1 5 ) ) ; 
 
                         / /   d r a w   c o v e r   a r t 
 
                         i f ( c o v e r . s h o w   & &   c o v e r . v i s i b l e   & &   t h i s . y > ( 0 - g r o u p . n b r o w s * r o w . h )   & &   t h i s . y < ( w h - t o o l b a r . h ) + ( g r o u p . n b r o w s * r o w . h ) )   { 
 
                                 / /   c o v e r   b g 
 
                                 v a r   c v _ x   =   t h i s . x + c o v e r . m a r g i n ; 
 
                                 v a r   c v _ y   =   ( ( t h i s . y + r o w . h ) - ( r o w . h * g r o u p . n b r o w s ) ) + c o v e r . m a r g i n ; 
 
                             v a r   c v _ w   =   c o v e r . w - c o v e r . m a r g i n * 2 ; 
 
                     v a r   c v _ h   =   c o v e r . h - c o v e r . m a r g i n * 2 ; 
 
                                 i f ( ! c o v e r . k e e p a s p e c t r a t i o )   { 
 
                                         g r . F i l l S o l i d R e c t ( c v _ x + 1 ,   c v _ y + 1 ,   c v _ w - 2 ,   c v _ h - 2 ,   g _ b a c k c o l o r ) ; 
 
                                         g r . F i l l S o l i d R e c t ( c v _ x + 1 ,   c v _ y + 1 ,   c v _ w - 2 ,   c v _ h - 2 ,   g _ t e x t c o l o r & 0 x 1 5 f f f f f f ) ; 
 
                                         g r . D r a w R e c t ( c v _ x ,   c v _ y ,   c v _ w - 1 ,   c v _ h - 1 ,   1 . 0 ,   g _ t e x t c o l o r & 0 x 8 0 f f f f f f ) ; 
 
                                 } ; 
 
                                 / / 
 
                                 t h i s . c o v e r _ i m g   =   g _ i m a g e _ c a c h e . h i t ( t h i s ) ; 
 
                                 / / 
 
                                 i f ( t h i s . c o v e r _ i m g )   { 
 
                                         i f ( c o v e r . k e e p a s p e c t r a t i o )   { 
 
                                                 / /   * * *   c h e c k   a s p e c t   r a t i o   * * *   / / 
 
                                                 i f ( t h i s . c o v e r _ i m g . H e i g h t > = t h i s . c o v e r _ i m g . W i d t h )   { 
 
                                                         v a r   r a t i o   =   t h i s . c o v e r _ i m g . W i d t h   /   t h i s . c o v e r _ i m g . H e i g h t ; 
 
                                                         v a r   p w   =   c v _ w * r a t i o ; 
 
                                                         v a r   p h   =   c v _ h ; 
 
                                                         t h i s . l e f t   =   M a t h . f l o o r ( ( p h - p w )   /   2 ) ; 
 
                                                         t h i s . t o p   =   0 ; 
 
                                                         c v _ x   + =   t h i s . l e f t ; 
 
                                                         c v _ y   + =   t h i s . t o p * 1 ; 
 
                                                         c v _ w   =   c v _ w   -   t h i s . l e f t * 2   -   c o v e r . m a r g i n   -   1 ; 
 
                                                         c v _ h   =   c v _ h   -   t h i s . t o p * 2   -   c o v e r . m a r g i n   -   1 ; 
 
                                                 }   e l s e   { 
 
                                                         v a r   r a t i o   =   t h i s . c o v e r _ i m g . H e i g h t   /   t h i s . c o v e r _ i m g . W i d t h ; 
 
                                                         v a r   p w   =   c v _ w ; 
 
                                                         v a r   p h   =   c v _ h * r a t i o ; 
 
                                                         t h i s . t o p   =   M a t h . f l o o r ( ( p w - p h )   /   2 ) ; 
 
                                                         t h i s . l e f t   =   0 ; 
 
                                                         c v _ x   + =   t h i s . l e f t ; 
 
                                                         c v _ y   + =   t h i s . t o p * 1 ; 
 
                                                         c v _ w   =   c v _ w   -   t h i s . l e f t * 2   -   c o v e r . m a r g i n   -   1 ; 
 
                                                         c v _ h   =   c v _ h   -   t h i s . t o p * 2   -   c o v e r . m a r g i n   -   1 ; 
 
                                                 } ; 
 
                                                 / /   * * *   c h e c k   a s p e c t   r a t i o   * * *   / / 
 
                                         } ; 
 
                                         
 
                                         / /   D r a w   C o v e r   A r t   ( w h e n   a v a i l a b l e ) 
 
                                         i f ( c o v e r . k e e p a s p e c t r a t i o )   { 
 
                                                 g r . D r a w R e c t ( c v _ x + 2 ,   c v _ y + 2 ,   c v _ w + c o v e r . m a r g i n * 1 ,   c v _ h + c o v e r . m a r g i n * 1 ,   1 . 0 ,   R G B A ( 0 , 0 , 0 , 1 5 ) ) ; 
 
                                                 g r . D r a w R e c t ( c v _ x + 1 ,   c v _ y + 1 ,   c v _ w + c o v e r . m a r g i n * 1 ,   c v _ h + c o v e r . m a r g i n * 1 ,   1 . 0 ,   R G B A ( 0 , 0 , 0 , 4 5 ) ) ; 
 
                                                 g r . D r a w I m a g e ( t h i s . c o v e r _ i m g ,   c v _ x ,   c v _ y ,   c o v e r . w ,   c o v e r . h ,   0 ,   0 ,   c o v e r . w ,   c o v e r . h ,   0 ,   2 5 5 ) ; 
 
                                                 g r . D r a w R e c t ( c v _ x ,   c v _ y ,   c v _ w + c o v e r . m a r g i n * 1 ,   c v _ h + c o v e r . m a r g i n * 1 ,   1 . 0 ,   g _ b a c k c o l o r ) ; 
 
                                                 g r . D r a w R e c t ( c v _ x ,   c v _ y ,   c v _ w + c o v e r . m a r g i n * 1 ,   c v _ h + c o v e r . m a r g i n * 1 ,   1 . 0 ,   g _ t e x t c o l o r & 0 x 8 0 f f f f f f ) ;                                         
 
                                         }   e l s e   { 
 
                                                 g r . D r a w R e c t ( c v _ x + 2 ,   c v _ y + 2 ,   c v _ w - 1 ,   c v _ h - 1 ,   1 . 0 ,   R G B A ( 0 , 0 , 0 , 1 5 ) ) ; 
 
                                                 g r . D r a w R e c t ( c v _ x + 1 ,   c v _ y + 1 ,   c v _ w - 1 ,   c v _ h - 1 ,   1 . 0 ,   R G B A ( 0 , 0 , 0 , 4 5 ) ) ; 
 
                                                 g r . D r a w I m a g e ( t h i s . c o v e r _ i m g ,   c v _ x ,   c v _ y ,   c o v e r . w ,   c o v e r . h ,   0 ,   0 ,   c o v e r . w ,   c o v e r . h ,   0 ,   2 5 5 ) ; 
 
                                                 g r . D r a w R e c t ( c v _ x ,   c v _ y ,   c v _ w - 1 ,   c v _ h - 1 ,   1 . 0 ,   g _ b a c k c o l o r ) ; 
 
                                                 g r . D r a w R e c t ( c v _ x ,   c v _ y ,   c v _ w - 1 ,   c v _ h - 1 ,   1 . 0 ,   g _ t e x t c o l o r & 0 x 8 0 f f f f f f ) ; 
 
                                         } ; 
 
                                 } ; 
 
                         } ; 
 
                         
 
                         / /   d r a w   T F   t e x t   i n f o   o f   t h e   g r o u p   h e a d e r 
 
                         v a r   g r p _ y   =   c o v e r . m a r g i n + t h i s . y - ( ( g r o u p . n b r o w s - 1 ) * r o w . h ) ; 
 
                         v a r   g r p _ h   =   g r o u p . n b r o w s * r o w . h   -   c o v e r . m a r g i n * 2 ; 
 
                         
 
                         / /   Y e a r   i n f o   ( &   d a t e   s e p a r a t o r   &   b a c k g o u n d ) 
 
                         i f ( y e a r _ w > 0 )   { 
 
                                 g r . F i l l S o l i d R e c t ( w w - v s c r o l l b a r . w - y e a r _ w ,   t h i s . y - ( ( g r o u p . n b r o w s - 1 ) * r o w . h ) ,   y e a r _ w ,   g r o u p . n b r o w s * r o w . h ,   R G B A ( 0 , 0 , 0 , 1 5 ) ) ; 
 
                                 g r . F i l l G r a d R e c t ( w w - v s c r o l l b a r . w - y e a r _ w ,   t h i s . y - ( ( g r o u p . n b r o w s - 1 ) * r o w . h ) ,   5 ,   g r o u p . n b r o w s * r o w . h ,   0 0 ,   R G B A ( 0 , 0 , 0 , 1 5 ) ,   0 ,   1 . 0 ) ; 
 
                                 g r . F i l l G r a d R e c t ( w w - v s c r o l l b a r . w - y e a r _ w - 1 ,   t h i s . y - ( ( g r o u p . n b r o w s - 1 ) * r o w . h ) + 5 ,   1 ,   g r o u p . n b r o w s * r o w . h - 1 0 ,   9 0 ,   0 ,   R G B A ( 2 5 5 , 2 5 5 , 2 5 5 , 2 5 ) ,   0 . 5 ) ; 
 
                                 g r . F i l l G r a d R e c t ( w w - v s c r o l l b a r . w - y e a r _ w + 0 ,   t h i s . y - ( ( g r o u p . n b r o w s - 1 ) * r o w . h ) + 5 ,   1 ,   g r o u p . n b r o w s * r o w . h - 1 0 ,   9 0 ,   0 ,   R G B A ( 0 , 0 , 0 , 4 0 ) ,   0 . 5 ) ; 
 
                                 g r . F i l l G r a d R e c t ( w w - v s c r o l l b a r . w - y e a r _ w + 1 ,   t h i s . y - ( ( g r o u p . n b r o w s - 1 ) * r o w . h ) + 1 0 ,   1 ,   g r o u p . n b r o w s * r o w . h - 2 0 ,   9 0 ,   0 ,   R G B A ( 0 , 0 , 0 , 1 5 ) ,   0 . 5 ) ; 
 
                                 g r . F i l l G r a d R e c t ( w w - v s c r o l l b a r . w - y e a r _ w + 1 ,   t h i s . y - ( ( g r o u p . n b r o w s - 1 ) * r o w . h ) + 1 5 ,   1 ,   g r o u p . n b r o w s * r o w . h - 3 0 ,   9 0 ,   0 ,   R G B A ( 0 , 0 , 0 , 5 ) ,   0 . 5 ) ; 
 
                                 g r . S e t T e x t R e n d e r i n g H i n t ( 3 ) ; 
 
                                 g r . D r a w S t r i n g ( t h i s . d a t e ,   g h _ d a t e _ f o n t ,   g _ b a c k c o l o r & 0 x d d f f f f f f ,   y e a r _ x ,   g r p _ y - 7 ,   y e a r _ w ,   g r o u p . n b r o w s * r o w . h - 1 ,   l c _ s t r i n g f o r m a t ) ;   / / g _ b a c k c o l o r & 0 x d d f f f f f f 
 
                                 g r . D r a w S t r i n g ( t h i s . d a t e ,   g h _ d a t e _ f o n t ,   p p t . d a t e _ c o l o r & R G B A ( 2 5 5 , 2 5 5 , 2 5 5 , p p t . d a t e _ c o l o r _ a l p h a ) ,   y e a r _ x ,   g r p _ y - 8 ,   y e a r _ w ,   g r o u p . n b r o w s * r o w . h - 1 ,   l c _ s t r i n g f o r m a t ) ;   / / g _ t e x t c o l o r & 0 x 5 5 f f f f f f 
 
                         } ; 
 
                         
 
                         / /   A r t i s t   +   A l b u m   i n f o s 
 
                         i f ( g r o u p . t y p e = = 0 )   { 
 
                                 v a r   a l b u m _ t a g   =   t h i s . a l b u m . l e n g t h > 0 ? t h i s . a l b u m : ( t o t a l _ g r p _ i t e m s > 1 ? " S i n g l e s " : " S i n g l e " ) ; 
 
                                 i f ( g r o u p . n b r o w s > 1 )   { 
 
                                         v a r   t e x t _ x   =   ( c o v e r . s h o w   & &   c o v e r . v i s i b l e )   ?   t h i s . x + c o v e r . w   :   t h i s . x   +   c o v e r . m a r g i n ; 
 
                                         v a r   t e x t _ w   =   ( w w - v s c r o l l b a r . w ) - c o v e r . w - c o v e r . m a r g i n * 2 - ( y e a r _ w - 5 ) ; 
 
                                         t r y   { 
 
                                                 g r . G d i D r a w T e x t ( t h i s . a l b u m a r t i s t ,   g _ f o n t _ h e a d e r s ,   g _ t e x t c o l o r _ h l ,   t e x t _ x ,   g r p _ y ,   t e x t _ w ,   M a t h . f l o o r ( g r p _ h / g r o u p . n b r o w s ) ,   D T _ L E F T   |   D T _ C A L C R E C T   |   D T _ V C E N T E R   |   D T _ E N D _ E L L I P S I S   |   D T _ N O P R E F I X ) ; 
 
                                                 g r . G d i D r a w T e x t ( a l b u m _ t a g + t h i s . d i s c _ i n f o ,   g _ f o n t _ h e a d e r s ,   g _ t e x t c o l o r _ h l ,   t e x t _ x ,   g r p _ y + M a t h . f l o o r ( g r p _ h / g r o u p . n b r o w s ) ,   t e x t _ w ,   M a t h . c e i l ( g r p _ h / g r o u p . n b r o w s ) ,   D T _ L E F T   |   D T _ C A L C R E C T   |   D T _ V C E N T E R   |   D T _ E N D _ E L L I P S I S   |   D T _ N O P R E F I X ) ; 
 
                                         }   c a t c h ( e )   { 
 
                                                 g r . G d i D r a w T e x t ( t h i s . a l b u m a r t i s t ,   g d i . F o n t ( " t a h o m a " , 1 1 ) ,   g _ t e x t c o l o r _ h l ,   t e x t _ x ,   g r p _ y ,   t e x t _ w ,   M a t h . f l o o r ( g r p _ h / g r o u p . n b r o w s ) ,   D T _ L E F T   |   D T _ C A L C R E C T   |   D T _ V C E N T E R   |   D T _ E N D _ E L L I P S I S   |   D T _ N O P R E F I X ) ; 
 
                                                 g r . G d i D r a w T e x t ( a l b u m _ t a g + t h i s . d i s c _ i n f o ,   g d i . F o n t ( " t a h o m a " , 1 1 ) ,   g _ t e x t c o l o r _ h l ,   t e x t _ x ,   g r p _ y + M a t h . f l o o r ( g r p _ h / g r o u p . n b r o w s ) ,   t e x t _ w ,   M a t h . c e i l ( g r p _ h / g r o u p . n b r o w s ) ,   D T _ L E F T   |   D T _ C A L C R E C T   |   D T _ V C E N T E R   |   D T _ E N D _ E L L I P S I S   |   D T _ N O P R E F I X ) ; 
 
                                         } ; 
 
                                 }   e l s e   { 
 
                                         g r . D r a w I m a g e ( s i n g l e l i n e _ g r o u p _ h e a d e r _ i c o n ,   c o v e r . m a r g i n ,   t h i s . y + M a t h . f l o o r ( r o w . h / 2 ) - 8 ,   1 6 ,   1 6 ,   0 ,   0 ,   1 6 ,   1 6 ,   0 ,   2 5 5 ) ; 
 
                                         v a r   t e x t _ x   =   t h i s . x + c o v e r . m a r g i n + s i n g l e l i n e _ g r o u p _ h e a d e r _ i c o n . W i d t h ; 
 
                                         v a r   t e x t _ w   =   w w - v s c r o l l b a r . w - c o v e r . m a r g i n * 2 - s i n g l e l i n e _ g r o u p _ h e a d e r _ i c o n . W i d t h ; 
 
                                         t r y   { 
 
                                                 g r . G d i D r a w T e x t ( t h i s . a l b u m a r t i s t + "   " + p a n e l . t a g _ s e p a r a t o r + "   " + a l b u m _ t a g + t h i s . d i s c _ i n f o ,   g _ f o n t ,   g _ t e x t c o l o r _ h l ,   t e x t _ x ,   g r p _ y ,   t e x t _ w ,   g r p _ h ,   D T _ L E F T   |   D T _ C A L C R E C T   |   D T _ V C E N T E R   |   D T _ E N D _ E L L I P S I S   |   D T _ N O P R E F I X ) ; 
 
                                         }   c a t c h ( e )   { 
 
                                                 g r . G d i D r a w T e x t ( t h i s . a l b u m a r t i s t + "   " + p a n e l . t a g _ s e p a r a t o r + "   " + a l b u m _ t a g + t h i s . d i s c _ i n f o ,   g d i . F o n t ( " t a h o m a " , 1 1 ) ,   g _ t e x t c o l o r _ h l ,   t e x t _ x ,   g r p _ y ,   t e x t _ w ,   g r p _ h ,   D T _ L E F T   |   D T _ C A L C R E C T   |   D T _ V C E N T E R   |   D T _ E N D _ E L L I P S I S   |   D T _ N O P R E F I X ) ; 
 
                                         } ; 
 
                                 } ; 
 
                         }   e l s e   { 
 
                                 v a r   t _ p a t h   =   t h i s . g r o u p _ k e y ; 
 
                                 i f ( g r o u p . n b r o w s > 1 )   { 
 
                                         v a r   t e x t _ x   =   ( c o v e r . s h o w   & &   c o v e r . v i s i b l e )   ?   t h i s . x + c o v e r . w   :   t h i s . x   +   c o v e r . m a r g i n ; 
 
                                         v a r   t e x t _ w   =   ( w w - v s c r o l l b a r . w ) - c o v e r . w - c o v e r . m a r g i n * 2 - ( y e a r _ w - 5 ) ; 
 
                                         t r y   { 
 
                                                 g r . G d i D r a w T e x t ( t _ p a t h ,   g _ f o n t ,   g _ t e x t c o l o r _ h l ,   t e x t _ x ,   g r p _ y ,   t e x t _ w ,   g r p _ h ,   D T _ L E F T   |   D T _ C A L C R E C T   |   D T _ V C E N T E R   |   D T _ E N D _ E L L I P S I S   |   D T _ N O P R E F I X ) ; 
 
                                         }   c a t c h ( e )   { 
 
                                                 g r . G d i D r a w T e x t ( t _ p a t h ,   g d i . F o n t ( " t a h o m a " , 1 1 ) ,   g _ t e x t c o l o r _ h l ,   t e x t _ x ,   g r p _ y ,   t e x t _ w ,   g r p _ h ,   D T _ L E F T   |   D T _ C A L C R E C T   |   D T _ V C E N T E R   |   D T _ E N D _ E L L I P S I S   |   D T _ N O P R E F I X ) ; 
 
                                       } ; 
 
                                 }   e l s e   { 
 
                                         g r . D r a w I m a g e ( s i n g l e l i n e _ g r o u p _ h e a d e r _ i c o n ,   c o v e r . m a r g i n ,   t h i s . y + M a t h . f l o o r ( r o w . h / 2 ) - 8 ,   1 6 ,   1 6 ,   0 ,   0 ,   1 6 ,   1 6 ,   0 ,   2 5 5 ) ; 
 
                                         v a r   t e x t _ x   =   t h i s . x + c o v e r . m a r g i n + s i n g l e l i n e _ g r o u p _ h e a d e r _ i c o n . W i d t h ; 
 
                                         v a r   t e x t _ w   =   w w - v s c r o l l b a r . w - c o v e r . m a r g i n * 2 - s i n g l e l i n e _ g r o u p _ h e a d e r _ i c o n . W i d t h ; 
 
                                         t r y   { 
 
                                                 g r . G d i D r a w T e x t ( t _ p a t h ,   g _ f o n t ,   g _ t e x t c o l o r _ h l ,   t e x t _ x ,   g r p _ y ,   t e x t _ w ,   g r p _ h ,   D T _ L E F T   |   D T _ C A L C R E C T   |   D T _ V C E N T E R   |   D T _ E N D _ E L L I P S I S   |   D T _ N O P R E F I X ) ; 
 
                                         }   c a t c h ( e )   { 
 
                                                 g r . G d i D r a w T e x t ( t _ p a t h ,   g d i . F o n t ( " t a h o m a " , 1 1 ) ,   g _ t e x t c o l o r _ h l ,   t e x t _ x ,   g r p _ y ,   t e x t _ w ,   g r p _ h ,   D T _ L E F T   |   D T _ C A L C R E C T   |   D T _ V C E N T E R   |   D T _ E N D _ E L L I P S I S   |   D T _ N O P R E F I X ) ; 
 
                                         } ; 
 
                                 } ;   
 
                         } ; 
 
                         
 
                         / /   e x t r a   g r o u p   i n f o s   ( 3 r d   l i n e ) 
 
                         g r . S e t T e x t R e n d e r i n g H i n t ( 5 ) ; 
 
                         / / v a r   t o t a l _ g r p _ l e n g t h   =   T i m e F r o m S e c o n d s ( l i s t . g r o u p s [ l i s t . h l i s t [ t h i s . i d ] - 1 ] ) ; 
 
                         i f ( g r o u p . n b r o w s = = 2   & &   g r o u p . t y p e ! = 0 )   { 
 
                                 t r y   { 
 
                                         g r . D r a w S t r i n g ( t o t a l _ g r p _ i t e m s + ( t o t a l _ g r p _ i t e m s > 1 ? "   T R K S " : "   T R K " ) + "   |   " + t h i s . c o d e c + "   |   " + t h i s . g e n r e . t o U p p e r C a s e ( ) ,   m i n i _ f o n t ,   p p t . e x t r a _ g r o u p _ i n f o s _ c o l o r & R G B A ( 2 5 5 , 2 5 5 , 2 5 5 , p p t . e x t r a _ g r o u p _ i n f o s _ c o l o r _ a l p h a ) ,   t e x t _ x + 1 ,   ( t h i s . y - c o v e r . m a r g i n ) + 2 ,   t e x t _ w - 1 ,   r o w . h ,   l b _ s t r i n g f o r m a t ) ; 
 
                                 }   c a t c h ( e )   { 
 
                                         g r . D r a w S t r i n g ( t o t a l _ g r p _ i t e m s + ( t o t a l _ g r p _ i t e m s > 1 ? "   T R K S " : "   T R K " ) + "   |   " + t h i s . c o d e c + "   |   " + t h i s . g e n r e . t o U p p e r C a s e ( ) ,   g d i . F o n t ( " t a h o m a " , 1 1 ) ,   g _ t e x t c o l o r & 0 x 4 4 f f f f f f ,   t e x t _ x + 1 ,   ( t h i s . y - c o v e r . m a r g i n ) + 2 ,   t e x t _ w - 1 ,   r o w . h ,   l b _ s t r i n g f o r m a t ) ; 
 
                                 } ; 
 
                         }   e l s e   i f ( g r o u p . n b r o w s > 2 )   { 
 
                                 t r y   { 
 
                                         g r . D r a w S t r i n g ( t o t a l _ g r p _ i t e m s + ( t o t a l _ g r p _ i t e m s > 1 ? "   T R K S " : "   T R K " ) + "   |   " + t h i s . c o d e c + "   |   " + t h i s . g e n r e . t o U p p e r C a s e ( ) ,   m i n i _ f o n t ,   p p t . e x t r a _ g r o u p _ i n f o s _ c o l o r & R G B A ( 2 5 5 , 2 5 5 , 2 5 5 , p p t . e x t r a _ g r o u p _ i n f o s _ c o l o r _ a l p h a ) ,   t e x t _ x + 1 ,   ( t h i s . y - c o v e r . m a r g i n ) + 2 ,   t e x t _ w - 1 ,   r o w . h ,   l c _ s t r i n g f o r m a t ) ; 
 
                                 }   c a t c h ( e )   { 
 
                                         g r . D r a w S t r i n g ( t o t a l _ g r p _ i t e m s + ( t o t a l _ g r p _ i t e m s > 1 ? "   T R K S " : "   T R K " ) + "   |   " + t h i s . c o d e c + "   |   " + t h i s . g e n r e . t o U p p e r C a s e ( ) ,   g d i . F o n t ( " t a h o m a " , 1 1 ) ,   g _ t e x t c o l o r & 0 x 4 4 f f f f f f ,   t e x t _ x + 1 ,   ( t h i s . y - c o v e r . m a r g i n ) + 2 ,   t e x t _ w - 1 ,   r o w . h ,   l c _ s t r i n g f o r m a t ) ; 
 
                                 } ; 
 
                         } ; 
 
                 } ; 
 
                 
 
                 i f ( g r o u p . n b r o w s > 0   & &   t h i s . g r i d x > 0 )   { 
 
                         / /   i f   d r a g g i n g   i t e m s ,   d r a w   l i n e   a t   t o p   o f   t h e   h o v e r   i t e m s   t o   s h o w   w h e r e   d r a g g e d   i t e m s   w i l l   b e   i n s e r t e d   o n   m o u s e   b u t t o n   u p 
 
                         / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 
 
                         i f ( ! p p t . t o u c h _ o n   & &   d r a g n d r o p . d r a g _ i n   & &   t h i s . i s h o v e r   & &   p a n e l . i s h o v e r )   { 
 
                                 i f ( ! p l m a n . I s P l a y l i s t I t e m S e l e c t e d ( p l m a n . A c t i v e P l a y l i s t ,   t h i s . i d ) )   { 
 
                                         i f ( t h i s . i d < = d r a g n d r o p . d r a g _ i d )   { 
 
                                                 g r . D r a w L i n e ( t h i s . x + 5 ,   t h i s . y - ( t h i s . g r i d x - 1 ) * r o w . h ,   w w - v s c r o l l b a r . w - 5 ,   t h i s . y - ( t h i s . g r i d x - 1 ) * r o w . h ,   2 . 0 ,   g _ t e x t c o l o r ) ; 
 
                                                 g r . D r a w I m a g e ( i c o n _ a r r o w _ l e f t ,   t h i s . x ,   t h i s . y - ( t h i s . g r i d x - 1 ) * r o w . h - 4 ,   8 ,   8 ,   0 ,   0 ,   8 ,   8 ,   0 ,   2 5 5 ) ; 
 
                                                 g r . D r a w I m a g e ( i c o n _ a r r o w _ l e f t ,   t h i s . x + w w - v s c r o l l b a r . w ,   t h i s . y - ( t h i s . g r i d x - 1 ) * r o w . h - 4 ,   - 8 ,   8 ,   0 ,   0 ,   8 ,   8 ,   0 ,   2 5 5 ) ; 
 
                                                 d r a g n d r o p . d r o p _ i d   =   t h i s . i d ; 
 
                                         }   e l s e   { 
 
                                                 g r . D r a w L i n e ( t h i s . x + 5 ,   t h i s . y + ( g r o u p . n b r o w s - t h i s . g r i d x + 1 ) * r o w . h ,   w w - v s c r o l l b a r . w - 5 ,   t h i s . y + ( g r o u p . n b r o w s - t h i s . g r i d x + 1 ) * r o w . h ,   2 . 0 ,   g _ t e x t c o l o r ) ; 
 
                                                 g r . D r a w I m a g e ( i c o n _ a r r o w _ l e f t ,   t h i s . x ,   t h i s . y + ( g r o u p . n b r o w s - t h i s . g r i d x + 1 ) * r o w . h - 4 ,   8 ,   8 ,   0 ,   0 ,   8 ,   8 ,   0 ,   2 5 5 ) ; 
 
                                                 g r . D r a w I m a g e ( i c o n _ a r r o w _ l e f t ,   t h i s . x + w w - v s c r o l l b a r . w ,   t h i s . y + ( g r o u p . n b r o w s - t h i s . g r i d x + 1 ) * r o w . h - 4 ,   - 8 ,   8 ,   0 ,   0 ,   8 ,   8 ,   0 ,   2 5 5 ) ; 
 
                                                 d r a g n d r o p . d r o p _ i d   =   t h i s . i d > 0 ? t h i s . i d - 1 : 0 ; 
 
                                         } ; 
 
                                 } ; 
 
                         } ;                         
 
                         / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 
 
                 } ; 
 
                 
 
         } ; 
 
 
 
         t h i s . c h e c k s t a t e   =   f u n c t i o n   ( e v e n t ,   x ,   y ,   i d )   { 
 
                 v a r   s t a t e   =   0 ; 
 
                 i f ( y < t o o l b a r . d e l t a )   r e t u r n   t r u e ; 
 
                 v a r   a c t _ p l s   =   p l m a n . A c t i v e P l a y l i s t ; 
 
                 v a r   p r e v _ r a t i n g _ h o v e r   =   t h i s . r a t i n g _ h o v e r ; 
 
                 v a r   p r e v _ l _ r a t i n g   =   t h i s . l _ r a t i n g ; 
 
                 v a r   p r e v _ m o o d _ h o v e r   =   t h i s . m o o d _ h o v e r ; 
 
                 v a r   p r e v _ l _ m o o d   =   t h i s . l _ m o o d ; 
 
                 i f ( y > t o o l b a r . h )   { 
 
                         t h i s . i s h o v e r   =   ( x   >   t h i s . x   & &   x   <   t h i s . x   +   t h i s . w   -   v s c r o l l b a r . w   & &   y   > =   t h i s . y   & &   y   <   t h i s . y   +   t h i s . h ) ; 
 
                 }   e l s e   { 
 
                         t h i s . i s h o v e r   =   f a l s e ; 
 
                 } ; 
 
                 t h i s . r a t i n g _ h o v e r   =   ( t h i s . g r i d x = = 0   & &   x > = c o l u m n s . r a t i n g _ x   & &   x < = c o l u m n s . r a t i n g _ x + c o l u m n s . r a t i n g _ w   & &   y > t h i s . y + 2   & &   y < t h i s . y + t h i s . h - 2 ) ; 
 
                 t h i s . m o o d _ h o v e r   =   ( t h i s . g r i d x = = 0   & &   x > = c o l u m n s . m o o d _ x   & &   x < = c o l u m n s . m o o d _ x + c o l u m n s . m o o d _ w - 3   & &   y > t h i s . y + 2   & &   y < t h i s . y + t h i s . h - 2 ) ; 
 
                 
 
                 i f ( r o w . b u t t o n s _ h o v e r )   { 
 
                         t o o l b a r . t i m e r I D _ o n   & &   w i n d o w . C l e a r T i m e o u t ( t o o l b a r . t i m e r I D _ o n ) ; 
 
                         t o o l b a r . t i m e r I D _ o n   =   f a l s e ; 
 
                 }   e l s e   { 
 
                         r o w . b u t t o n s _ h o v e r   =   ( t h i s . r a t i n g _ h o v e r   | |   t h i s . m o o d _ h o v e r ) ; 
 
                 } ; 
 
                 
 
                 s w i t c h   ( e v e n t )   { 
 
                 c a s e   " d o w n " : 
 
                         i f ( t h i s . g r i d x > 0 )   { 
 
                                 i f ( t h i s . i s h o v e r )   { 
 
                                         S e l e c t G r o u p I t e m s ( t h i s . i d ) ; 
 
                                         i f ( l i s t . m e t a d b l i s t _ s e l e c t i o n . C o u n t > = 1 )   { 
 
                                                 d r a g n d r o p . d r a g _ o u t   =   t r u e ; 
 
                                                 d r a g n d r o p . d r a g _ i d   =   t h i s . i d ; 
 
                                                 i f ( ! i s Q u e u e P l a y l i s t A c t i v e ( ) )   { 
 
                                                         d r a g n d r o p . t i m e r I D   =   w i n d o w . S e t T i m e o u t ( f u n c t i o n ( )   { 
 
                                                                 d r a g n d r o p . d r a g _ i n   =   t r u e ; 
 
                                                                 d r a g n d r o p . t i m e r I D   & &   w i n d o w . C l e a r T i m e o u t ( d r a g n d r o p . t i m e r I D ) ; 
 
                                                                 d r a g n d r o p . t i m e r I D   =   f a l s e ; 
 
                                                         } ,   2 5 0 ) ; 
 
                                                 } ; 
 
                                         } ; 
 
                                 } ; 
 
                         }   e l s e   { 
 
                                 i f ( t h i s . r a t i n g _ h o v e r )   { 
 
                                         c o l u m n s . r a t i n g _ d r a g   =   t r u e ; 
 
                                 }   e l s e   i f ( t h i s . m o o d _ h o v e r )   { 
 
                                         c o l u m n s . m o o d _ d r a g   =   t r u e ; 
 
                                 }   e l s e   { 
 
                                         i f ( p l m a n . I s P l a y l i s t I t e m S e l e c t e d ( a c t _ p l s ,   t h i s . i d ) )   { 
 
                                                 i f ( t h i s . i s h o v e r )   { 
 
                                                         i f ( l i s t . m e t a d b l i s t _ s e l e c t i o n . C o u n t > = 1 )   { 
 
                                                                 d r a g n d r o p . d r a g _ o u t   =   t r u e ; 
 
                                                                 i f ( l i s t . m e t a d b l i s t _ s e l e c t i o n . C o u n t > 1 )   { 
 
                                                                         / /   t e s t   i f   s e l e c t i o n   i s   c o n t i g u s ,   i f   n o t ,   d r a g ' n   d r o p   d i s a b l e 
 
                                                                         v a r   f i r s t _ i t e m _ s e l e c t e d _ i d   =   l i s t . h a n d l e l i s t . F i n d ( l i s t . m e t a d b l i s t _ s e l e c t i o n . i t e m ( 0 ) ) ; 
 
                                                                         v a r   l a s t _ i t e m _ s e l e c t e d _ i d   =   l i s t . h a n d l e l i s t . F i n d ( l i s t . m e t a d b l i s t _ s e l e c t i o n . i t e m ( l i s t . m e t a d b l i s t _ s e l e c t i o n . C o u n t - 1 ) ) ; 
 
                                                                         v a r   c o n t i g u s _ c o u n t   =   ( l a s t _ i t e m _ s e l e c t e d _ i d   -   f i r s t _ i t e m _ s e l e c t e d _ i d ) + 1 ; 
 
                                                                 }   e l s e   { 
 
                                                                         v a r   c o n t i g u s _ c o u n t   =   0 ; 
 
                                                                 } ; 
 
                                                                 i f ( l i s t . m e t a d b l i s t _ s e l e c t i o n . C o u n t = = 1   | |   l i s t . m e t a d b l i s t _ s e l e c t i o n . C o u n t   = =   c o n t i g u s _ c o u n t )   { 
 
                                                                         d r a g n d r o p . d r a g _ i d   =   t h i s . i d ; 
 
                                                                         i f ( ! i s Q u e u e P l a y l i s t A c t i v e ( ) )   { 
 
                                                                                 d r a g n d r o p . t i m e r I D   =   w i n d o w . S e t T i m e o u t ( f u n c t i o n ( )   { 
 
                                                                                         d r a g n d r o p . d r a g _ i n   =   t r u e ; 
 
                                                                                         d r a g n d r o p . t i m e r I D   & &   w i n d o w . C l e a r T i m e o u t ( d r a g n d r o p . t i m e r I D ) ; 
 
                                                                                         d r a g n d r o p . t i m e r I D   =   f a l s e ; 
 
                                                                                 } ,   2 5 0 ) ; 
 
                                                                         } ; 
 
                                                                 } ; 
 
                                                         } ; 
 
                                                         i f ( u t i l s . I s K e y P r e s s e d ( V K _ S H I F T ) )   { 
 
                                                                 i f ( l i s t . f o c u s _ i d   ! =   t h i s . i d )   { 
 
                                                                         i f ( l i s t . S H I F T _ s t a r t _ i d ! = n u l l )   { 
 
                                                                                 S e l e c t A t o B ( l i s t . S H I F T _ s t a r t _ i d ,   t h i s . i d ) ; 
 
                                                                         }   e l s e   { 
 
                                                                                 S e l e c t A t o B ( l i s t . f o c u s _ i d ,   t h i s . i d ) ; 
 
                                                                         } ; 
 
                                                                 } ; 
 
                                                         }   e l s e   i f ( u t i l s . I s K e y P r e s s e d ( V K _ C O N T R O L ) )   { 
 
                                                                 i f ( p l m a n . G e t P l a y l i s t F o c u s I t e m I n d e x ( a c t _ p l s ) ! = t h i s . i d )   { 
 
                                                                         p l m a n . S e t P l a y l i s t S e l e c t i o n S i n g l e ( a c t _ p l s ,   t h i s . i d ,   f a l s e ) ; 
 
                                                                 } ; 
 
                                                         }   e l s e   i f ( l i s t . m e t a d b l i s t _ s e l e c t i o n . C o u n t = = 1 )   { 
 
                                                                 p l m a n . S e t P l a y l i s t F o c u s I t e m ( a c t _ p l s ,   t h i s . i d ) ; 
 
                                                                 p l m a n . C l e a r P l a y l i s t S e l e c t i o n ( a c t _ p l s ) ; 
 
                                                                 p l m a n . S e t P l a y l i s t S e l e c t i o n S i n g l e ( a c t _ p l s ,   t h i s . i d ,   t r u e ) ; 
 
                                                         } ; 
 
                                                 } ; 
 
                                         }   e l s e   { 
 
                                                 i f ( t h i s . i s h o v e r )   { 
 
                                                         i f ( u t i l s . I s K e y P r e s s e d ( V K _ S H I F T ) )   { 
 
                                                                 i f ( l i s t . f o c u s _ i d   ! =   t h i s . i d )   { 
 
                                                                         i f ( l i s t . S H I F T _ s t a r t _ i d ! = n u l l )   { 
 
                                                                                 S e l e c t A t o B ( l i s t . S H I F T _ s t a r t _ i d ,   t h i s . i d ) ; 
 
                                                                         }   e l s e   { 
 
                                                                                 S e l e c t A t o B ( l i s t . f o c u s _ i d ,   t h i s . i d ) ; 
 
                                                                         } ; 
 
                                                                 } ; 
 
                                                         }   e l s e   i f ( u t i l s . I s K e y P r e s s e d ( V K _ C O N T R O L ) )   { 
 
                                                                 p l m a n . S e t P l a y l i s t F o c u s I t e m ( a c t _ p l s ,   t h i s . i d ) ; 
 
                                                                 p l m a n . S e t P l a y l i s t S e l e c t i o n S i n g l e ( a c t _ p l s ,   t h i s . i d ,   t r u e ) ; 
 
                                                         }   e l s e   { 
 
                                                                 p l m a n . S e t P l a y l i s t F o c u s I t e m ( a c t _ p l s ,   t h i s . i d ) ; 
 
                                                                 p l m a n . C l e a r P l a y l i s t S e l e c t i o n ( a c t _ p l s ) ; 
 
                                                                 p l m a n . S e t P l a y l i s t S e l e c t i o n S i n g l e ( a c t _ p l s ,   t h i s . i d ,   t r u e ) ; 
 
                                                         } ; 
 
                                                 } ; 
 
                                         } ; 
 
                                         l i s t . m e t a d b l i s t _ s e l e c t i o n   =   p l m a n . G e t P l a y l i s t S e l e c t e d I t e m s ( a c t _ p l s ) ; 
 
                                 } ; 
 
                         } ; 
 
                         b r e a k ; 
 
 
 
                 c a s e   " d b l c l k " : 
 
                         i f ( t h i s . g r i d x = = 0 )   { 
 
                                 i f ( t h i s . r a t i n g _ h o v e r )   { 
 
                                         
 
                                 }   e l s e   i f ( t h i s . m o o d _ h o v e r )   { 
 
                                         
 
                                 }   e l s e   { 
 
                                         i f ( ! i s Q u e u e P l a y l i s t A c t i v e ( ) )   { 
 
                                                 i f ( p l m a n . I s P l a y l i s t I t e m S e l e c t e d ( a c t _ p l s ,   t h i s . i d ) )   { 
 
                                                         i f ( t h i s . i s h o v e r )   { 
 
                                                                 p l m a n . E x e c u t e P l a y l i s t D e f a u l t A c t i o n ( a c t _ p l s ,   t h i s . i d ) ; 
 
                                                                 w i n d o w . R e p a i n t ( ) ; 
 
                                                         } ; 
 
                                                 } ; 
 
                                         } ; 
 
                                 } ; 
 
                         } ; 
 
                         b r e a k ; 
 
                         
 
                 c a s e   " r i g h t " : 
 
                         i f ( t h i s . i s h o v e r )   { 
 
                                 i f ( t h i s . r a t i n g _ h o v e r )   { 
 
                                         
 
                                 }   e l s e   i f ( t h i s . m o o d _ h o v e r )   { 
 
                                         
 
                                 }   e l s e   { 
 
                                         i f ( p l m a n . I s P l a y l i s t I t e m S e l e c t e d ( a c t _ p l s ,   t h i s . i d ) )   { 
 
                                                 
 
                                         }   e l s e   { 
 
                                                 p l m a n . S e t P l a y l i s t F o c u s I t e m ( a c t _ p l s ,   t h i s . i d ) ; 
 
                                                 p l m a n . C l e a r P l a y l i s t S e l e c t i o n ( a c t _ p l s ) ; 
 
                                                 p l m a n . S e t P l a y l i s t S e l e c t i o n S i n g l e ( a c t _ p l s ,   t h i s . i d ,   t r u e ) ; 
 
                                         } ; 
 
                                         n e w _ c o n t e x t _ m e n u ( x ,   y ,   t h i s . i d ,   t h i s . i d x ) ; 
 
                                         s t a t e   =   - 1 ; 
 
                                 } ; 
 
                         } ; 
 
                         b r e a k ; 
 
                         
 
                 c a s e   " u p " : 
 
                         i f ( t h i s . i s h o v e r )   { 
 
                                 i f ( t h i s . r a t i n g _ h o v e r )   { 
 
                                         / /   R a t i n g 
 
                                         i f ( t h i s . t r a c k _ t y p e < 2 )   { 
 
                                                 i f ( f o o _ p l a y c o u n t )   { 
 
                                                         / /   R a t e   t o   d a t a b a s e   s t a t i s t i c s   b r o u g h t   b y   f o o _ p l a y c o u n t . d l l 
 
                                                         i f   ( t h i s . l _ r a t i n g   ! =   t h i s . r a t i n g )   { 
 
                                                                 i f ( t h i s . m e t a d b )   { 
 
                                                                         v a r   b o o l   =   f b . R u n C o n t e x t C o m m a n d W i t h M e t a d b ( " R a t i n g / " + ( ( t h i s . l _ r a t i n g = = 0 )   ?   " < n o t   s e t > "   :   t h i s . l _ r a t i n g ) ,   t h i s . m e t a d b ) ; 
 
                                                                         t h i s . r a t i n g   =   t h i s . l _ r a t i n g ; 
 
                                                                 } ; 
 
                                                         }   e l s e   { 
 
                                                                 v a r   b o o l   =   f b . R u n C o n t e x t C o m m a n d W i t h M e t a d b ( " R a t i n g / < n o t   s e t > " ,   t h i s . m e t a d b ) ; 
 
                                                                 t h i s . r a t i n g   =   0 ; 
 
                                                         } ; 
 
                                                 }   e l s e   { 
 
                                                         / /   R a t e   t o   f i l e 
 
                                                         i f   ( t h i s . l _ r a t i n g   ! =   t h i s . r a t i n g )   { 
 
                                                                 i f ( t h i s . m e t a d b )   { 
 
                                                                         v a r   b o o l   =   t h i s . m e t a d b . U p d a t e F i l e I n f o S i m p l e ( " R A T I N G " ,   t h i s . l _ r a t i n g ) ; 
 
                                                                         t h i s . r a t i n g   =   t h i s . l _ r a t i n g ; 
 
                                                                 } ; 
 
                                                         }   e l s e   { 
 
                                                                 v a r   b o o l   =   t h i s . m e t a d b . U p d a t e F i l e I n f o S i m p l e ( " R A T I N G " , " " ) ; 
 
                                                                 t h i s . r a t i n g   =   0 ; 
 
                                                         } ; 
 
                                                 } ; 
 
                                         } ; 
 
                                 }   e l s e   i f ( t h i s . m o o d _ h o v e r )   { 
 
                                         / /   M o o d 
 
                                         i f ( t h i s . t r a c k _ t y p e < 2 )   { 
 
                                                 / /   t a g   t o   f i l e 
 
                                                 i f   ( t h i s . l _ m o o d   ! =   t h i s . m o o d )   { 
 
                                                         i f ( t h i s . m e t a d b )   { 
 
                                                                 v a r   b o o l   =   t h i s . m e t a d b . U p d a t e F i l e I n f o S i m p l e ( " M O O D " ,   g e t T i m e s t a m p ( ) ) ; 
 
                                                                 t h i s . m o o d   =   t h i s . l _ m o o d ; 
 
                                                         } ; 
 
                                                 }   e l s e   { 
 
                                                         v a r   b o o l   =   t h i s . m e t a d b . U p d a t e F i l e I n f o S i m p l e ( " M O O D " , " " ) ; 
 
                                                         t h i s . m o o d   =   0 ; 
 
                                                 } ; 
 
                                         } ; 
 
                                 }   e l s e   { 
 
                                         i f ( p l m a n . I s P l a y l i s t I t e m S e l e c t e d ( a c t _ p l s ,   t h i s . i d ) )   { 
 
                                                 i f ( ! u t i l s . I s K e y P r e s s e d ( V K _ S H I F T )   & &   ! u t i l s . I s K e y P r e s s e d ( V K _ C O N T R O L ) )   { 
 
                                                         i f ( ! d r a g n d r o p . d r a g _ i n )   { 
 
                                                                 i f ( t h i s . g r i d x = = 0 )   { 
 
                                                                         p l m a n . S e t P l a y l i s t F o c u s I t e m ( a c t _ p l s ,   t h i s . i d ) ; 
 
                                                                         p l m a n . C l e a r P l a y l i s t S e l e c t i o n ( a c t _ p l s ) ; 
 
                                                                         p l m a n . S e t P l a y l i s t S e l e c t i o n S i n g l e ( a c t _ p l s ,   t h i s . i d ,   t r u e ) ; 
 
                                                                 } ; 
 
                                                         } ; 
 
                                                         d r a g n d r o p . t i m e r I D   & &   w i n d o w . C l e a r T i m e o u t ( d r a g n d r o p . t i m e r I D ) ; 
 
                                                         d r a g n d r o p . t i m e r I D   =   f a l s e ; 
 
                                                         d r a g n d r o p . d r a g _ i n   =   f a l s e ; 
 
                                                         d r a g n d r o p . d r a g _ o u t   =   f a l s e ; 
 
                                                 } ; 
 
                                         } ; 
 
                                 } ; 
 
                         } ; 
 
                         c o l u m n s . r a t i n g _ d r a g   =   f a l s e ; 
 
                         c o l u m n s . m o o d _ d r a g   =   f a l s e ; 
 
                         b r e a k ; 
 
                         
 
                 c a s e   " m o v e " : 
 
 
 
                         i f ( c o l u m n s . r a t i n g   & &   ! c o l u m n s . r a t i n g _ d r a g )   { 
 
                                 i f ( t h i s . r a t i n g _ h o v e r )   { 
 
                                         t h i s . l _ r a t i n g   =   M a t h . f l o o r ( ( x   -   c o l u m n s . r a t i n g _ x )   /   ( g _ f o n t _ g u i f x _ f o u n d ? 1 4 : 1 2 ) )   +   1 ; 
 
                                         i f ( t h i s . l _ r a t i n g > 5 )   t h i s . l _ r a t i n g   =   5 ; 
 
                                 }   e l s e   { 
 
                                         t h i s . l _ r a t i n g   =   0 ; 
 
                                 } ; 
 
                                 i f ( t h i s . r a t i n g _ h o v e r   ! =   p r e v _ r a t i n g _ h o v e r   | |   t h i s . l _ r a t i n g   ! =   p r e v _ l _ r a t i n g )   { 
 
                                         r e p a i n t _ r a t i n g ( t h i s . y ) ; 
 
                                 } ; 
 
                         } ; 
 
                         i f ( c o l u m n s . m o o d   & &   ! c o l u m n s . m o o d _ d r a g )   { 
 
                                 i f ( t h i s . m o o d _ h o v e r )   { 
 
                                         t h i s . l _ m o o d   =   1 ; 
 
                                 }   e l s e   { 
 
                                         t h i s . l _ m o o d   =   0 ; 
 
                                 } ; 
 
                                 i f ( t h i s . m o o d _ h o v e r   ! =   p r e v _ m o o d _ h o v e r   | |   t h i s . l _ m o o d   ! =   p r e v _ l _ m o o d )   { 
 
                                         r e p a i n t _ m o o d ( t h i s . y ) ; 
 
                                 } ; 
 
                         } ; 
 
                         b r e a k ; 
 
                         
 
                 c a s e   " l e a v e " : 
 
                 
 
                         b r e a k ; 
 
                 } ; 
 
                 r e t u r n   s t a t e ; 
 
         } ; 
 
 } ; 
 
 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = / /   T i t l e f o r m a t   f i e l d 
 
 v a r   t f _ c o v e r _ p a t h   =   f b . T i t l e F o r m a t ( " $ r e p l a c e ( % p a t h % , % f i l e n a m e _ e x t % , ) " ) ; 
 
 v a r   t f _ t r a c k n u m b e r   =   f b . T i t l e F o r m a t ( " $ n u m ( $ i f 2 ( % t r a c k n u m b e r % , 0 ) , 2 ) " ) ; 
 
 v a r   t f _ a r t i s t   =   f b . T i t l e F o r m a t ( " $ i f ( % l e n g t h % , % a r t i s t % , ' S t r e a m ' ) " ) ; 
 
 v a r   t f _ t i t l e   =   f b . T i t l e F o r m a t ( " % t i t l e % " ) ; 
 
 v a r   t f _ a l b u m a r t i s t   =   f b . T i t l e F o r m a t ( " $ i f ( % l e n g t h % , % a l b u m   a r t i s t % , ' S t r e a m ' ) " ) ; 
 
 v a r   t f _ a l b u m   =   f b . T i t l e F o r m a t ( " $ i f 2 ( % a l b u m % , $ i f ( % l e n g t h % , , ' w e b   r a d i o s ' ) ) " ) ; 
 
 v a r   t f _ d i s c   =   f b . T i t l e F o r m a t ( " $ i f 2 ( % d i s c n u m b e r % , 0 ) " ) ; 
 
 v a r   t f _ d i s c _ i n f o   =   f b . T i t l e F o r m a t ( " $ i f ( % d i s c n u m b e r % , $ i f g r e a t e r ( % t o t a l d i s c s % , 1 , '   -   [ d i s c   ' % d i s c n u m b e r % $ i f ( % t o t a l d i s c s % , ' / ' % t o t a l d i s c s % ' ] ' , ' ] ' ) , ) , ) " ) ; 
 
 v a r   t f _ r a t i n g   =   f b . T i t l e F o r m a t ( " $ i f 2 ( % r a t i n g % , 0 ) " ) ; 
 
 v a r   t f _ m o o d   =   f b . T i t l e f o r m a t ( " $ i f ( % m o o d % , 1 , 0 ) " ) ; 
 
 v a r   t f _ p l a y c o u n t   =   f b . T i t l e F o r m a t ( " $ i f 2 ( % p l a y _ c o u n t e r % , $ i f 2 ( % p l a y _ c o u n t % , 0 ) ) " ) ; 
 
 v a r   t f _ d u r a t i o n   =   f b . T i t l e F o r m a t ( " $ i f 2 ( % l e n g t h % , '   0 : 0 0 ' ) " ) ; 
 
 v a r   t f _ d a t e   =   f b . T i t l e F o r m a t ( " [ $ y e a r ( $ r e p l a c e ( % d a t e % , / , - , . , - ) ) ] " ) ; 
 
 v a r   t f _ g e n r e   =   f b . T i t l e F o r m a t ( " $ i f 2 ( % g e n r e % , ' O t h e r ' ) " ) ; 
 
 v a r   t f _ p l a y b a c k _ t i m e   =   f b . T i t l e F o r m a t ( " % p l a y b a c k _ t i m e % " ) ; 
 
 v a r   t f _ p l a y b a c k _ t i m e _ r e m a i n i n g   =   f b . T i t l e F o r m a t ( " $ i f ( % l e n g t h % , - % p l a y b a c k _ t i m e _ r e m a i n i n g % , ' 0 : 0 0 ' ) " ) ; 
 
 v a r   t f _ l e n g t h _ s e c o n d s   =   f b . T i t l e F o r m a t ( " % l e n g t h _ s e c o n d s _ f p % " ) ; 
 
 / /   G R O U P 
 
 v a r   t f _ g r o u p _ k e y   =   f b . T i t l e F o r m a t ( g r o u p _ p a t t e r n _ a l b u m ) ; 
 
 / /   T E C H   
 
 v a r   t f _ c o d e c   =   f b . T i t l e f o r m a t ( " % _ _ c o d e c % " ) ; 
 
 v a r   t f _ s a m p l e r a t e   =   f b . T i t l e f o r m a t ( " % _ _ s a m p l e r a t e % " ) ; 
 
 v a r   t f _ b i t r a t e 2   =   f b . T i t l e f o r m a t ( " % _ _ b i t r a t e % " ) ; 
 
 v a r   t f _ b i t s p e r s a m p l e   =   f b . T i t l e f o r m a t ( " % _ _ b i t s p e r s a m p l e % " ) ; 
 
 v a r   t f _ b i t r a t e   =   f b . T i t l e F o r m a t ( " $ i f ( % _ _ b i t r a t e _ d y n a m i c % , $ i f ( % e l _ i s p l a y i n g % , % _ _ b i t r a t e _ d y n a m i c % ' K ' , $ i f ( $ s t r i c m p ( $ l e f t ( % c o d e c _ p r o f i l e % , 3 ) , ' V B R ' ) , % c o d e c _ p r o f i l e % , % _ _ b i t r a t e % ' K ' ) ) , $ i f ( $ s t r i c m p ( $ l e f t ( % c o d e c _ p r o f i l e % , 3 ) , ' V B R ' ) , % c o d e c _ p r o f i l e % , % _ _ b i t r a t e % ' K ' ) ) " ) ; 
 
 v a r   t f _ b i t r a t e _ p l a y i n g   =   f b . T i t l e F o r m a t ( " $ i f ( % _ _ b i t r a t e _ d y n a m i c % , $ i f ( % _ i s p l a y i n g % , $ s e l e c t ( $ a d d ( $ m o d ( % _ t i m e _ e l a p s e d _ s e c o n d s % , 2 ) , 1 ) , % _ _ b i t r a t e _ d y n a m i c % , % _ _ b i t r a t e _ d y n a m i c % ) , % _ _ b i t r a t e _ d y n a m i c % ) , % _ _ b i t r a t e % ) ' K ' " ) ; 
 
 v a r   t f _ c h a n n e l s   =   f b . T i t l e F o r m a t ( " $ i f ( $ s t r i c m p ( $ c o d e c ( ) , M P 3 ) , $ g e t ( s p a c e 2 ) $ c a p s ( % _ _ m p 3 _ s t e r e o _ m o d e % ) , $ i f ( % _ _ c h a n n e l s % , $ i f g r e a t e r ( % _ _ c h a n n e l s % , 1 , S t e r e o , M o n o ) , $ i f ( $ s t r c m p ( % _ _ c h a n n e l s % , 4 ) , 4   C h , $ s u b ( % _ _ c h a n n e l s % , 1 ) ' . 1 '   C h ) ) ) " ) ; 
 
 
 
 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = / /   G l o b a l s 
 
 v a r   g _ i n s t a n c e t y p e   =   w i n d o w . I n s t a n c e T y p e ; 
 
 v a r   g _ f o n t   =   n u l l ; 
 
 v a r   g _ f o n t _ h e a d e r s   =   n u l l ; 
 
 v a r   g h _ d a t e _ f o n t   =   g d i . F o n t ( p p t . f o n t _ d a t e _ n a m e ,   p p t . f o n t _ d a t e _ s i z e ,   p p t . f o n t _ d a t e _ s t y l e ) ; 
 
 v a r   g _ f o n t _ g u i f x _ f o u n d   =   u t i l s . C h e c k F o n t ( " g u i f x   v 2   t r a n s p o r t s " ) ; 
 
 v a r   r a t i n g _ f o n t   =   n u l l ; 
 
 v a r   m o o d _ f o n t   =   n u l l ; 
 
 v a r   d e l _ r a t i n g _ f o n t   =   n u l l ; 
 
 v a r   m i n i _ f o n t   =   g d i . F o n t ( p p t . f o n t _ m i n i _ n a m e ,   p p t . f o n t _ m i n i _ s i z e ,   0 ) ; 
 
 v a r   w w   =   0 ,   w h   =   0 ; 
 
 v a r   m o u s e _ x   =   0 ,   m o u s e _ y   =   0 ; 
 
 v a r   g _ t e x t c o l o r   =   0 ,   g _ t e x t c o l o r _ s e l   =   0 ,   g _ t e x t c o l o r _ h l   =   0 ,   g _ b a c k c o l o r   =   0 ,   g _ b a c k c o l o r _ s e l   =   0 ; 
 
 v a r   g _ b a c k c o l o r _ R   =   0 ,   g _ b a c k c o l o r _ G   =   0 ,   g _ b a c k c o l o r _ B   =   0 ; 
 
 v a r   g _ m e t a d b ; 
 
 v a r   b o o l _ o n _ s i z e   =   f a l s e ; 
 
 v a r   g _ s e a r c h _ s t r i n g   =   " " ; 
 
 v a r   i n c s e a r c h _ f o n t   =   g d i . F o n t ( " l u c i d a   c o n s o l e " ,   p p t . i n c s e a r c h _ f o n t _ s i z e ,   0 ) ; 
 
 v a r   i n c s e a r c h _ f o n t _ b i g   =   g d i . F o n t ( " l u c i d a   c o n s o l e " ,   p p t . i n c s e a r c h _ f o n t _ s i z e ,   1 ) ; 
 
 v a r   c l e a r _ i n c s e a r c h _ t i m e r   =   f a l s e ; 
 
 v a r   i n c s e a r c h _ t i m e r   =   f a l s e ; 
 
 v a r   g _ p l a y i n g _ i t e m _ y   =   n u l l ; 
 
 v a r   g _ s e c o n d s   =   0 ; 
 
 v a r   p r o g r e s s   =   0 ; 
 
 v a r   f o o _ p l a y c o u n t   =   u t i l s . C h e c k C o m p o n e n t ( " f o o _ p l a y c o u n t " ,   t r u e ) ; 
 
 v a r   g _ t o o l t i p   =   w i n d o w . C r e a t e T o o l t i p ( ) ; 
 
 v a r   g _ t o o l t i p _ t i m e r   =   f a l s e ; 
 
 v a r   s h o w _ t o o l t i p   =   f a l s e ; 
 
 v a r   g _ m e n u _ d i s p l a y e d   =   f a l s e ; 
 
 v a r   g _ a d d _ i t e m s _ t i m e r I D   =   f a l s e ; 
 
 v a r   g _ d r a g   =   f a l s e ; 
 
 
 
 p a n e l   =   { 
 
         t h e m e d :   w i n d o w . G e t P r o p e r t y ( " S Y S T E M . p a n e l . t h e m e d " ,   f a l s e ) , 
 
         / / w a l l p a p e r _ p a t h :   w i n d o w . G e t P r o p e r t y ( " * U S E R . b a c k g r o u n d . i m a g e . p a t h " ,   " . \ \ i m a g e s \ \ b a c k g r o u n d . j p g " ) , 
 
         w a l l p a p e r _ i m g :   f a l s e , 
 
         / / s h o w _ w a l l p a p e r :   w i n d o w . G e t P r o p e r t y ( " * U S E R . b a c k g r o u n d . i m a g e . e n a b l e d " ,   t r u e ) , 
 
         s h o w _ s h a d o w _ b o r d e r :   w i n d o w . G e t P r o p e r t y ( " S Y S T E M . s h a d o w . b o r d e r . e n a b l e d " ,   t r u e ) , 
 
         o p a c i t y :   w i n d o w . G e t P r o p e r t y ( " * U S E R . p a n e l . o p a c i t y . l e v e l   [ 0 , 2 5 5 ] " ,   5 0 ) , 
 
         c u s t o m _ t e x t c o l o r :   w i n d o w . G e t P r o p e r t y ( " * U S E R . c u s t o m . t e x t . c o l o r . n o r m a l " ,   " R G B ( 2 0 0 , 2 0 0 , 2 1 0 ) " ) , 
 
         c u s t o m _ t e x t c o l o r _ s e l e c t i o n :   w i n d o w . G e t P r o p e r t y ( " * U S E R . c u s t o m . t e x t . c o l o r . s e l e c t i o n " ,   " R G B ( 6 4 , 1 2 8 , 2 0 0 ) " ) , 
 
         c u s t o m _ t e x t c o l o r _ h i g h l i g h t :   w i n d o w . G e t P r o p e r t y ( " * U S E R . c u s t o m . t e x t . c o l o r . h i g h l i g h t " ,   " R G B ( 1 5 0 , 2 0 0 , 2 5 0 ) " ) , 
 
         c u s t o m _ b a c k c o l o r :   w i n d o w . G e t P r o p e r t y ( " * U S E R . c u s t o m . b a c k g r o u n d . c o l o r " ,   " R G B ( 3 0 , 3 0 , 3 5 ) " ) , 
 
         c u s t o m _ c o l o r s :   w i n d o w . G e t P r o p e r t y ( " S Y S T E M . p a n e l . c u s t o m . c o l o r s " ,   t r u e ) ,       
 
         n o g r o u p h e a d e r :   w i n d o w . G e t P r o p e r t y ( " S Y S T E M . n o . g r o u p . h e a d e r " ,   f a l s e ) , 
 
         t a g _ s e p a r a t o r :   w i n d o w . G e t P r o p e r t y ( " * U S E R . t i t l e - a r t i s t . s e p a r a t o r " ,   "  " ) , 
 
         p r o p e r t i e s _ s e p a r a t o r :   w i n d o w . G e t P r o p e r t y ( " - - - - - - - - - - - - - - - - - - - - - - - - - - - - " ,   " - - - - - - - - - - - - - - - - - - - - - - - - - - - - " ) 
 
 } ; 
 
 
 
 d r a g n d r o p   =   { 
 
         e n a b l e d :   w i n d o w . G e t P r o p e r t y ( " S Y S T E M . d r a g n d r o p . e n a b l e d " ,   f a l s e ) , 
 
         d r a g _ i d :   - 1 , 
 
         d r o p _ i d :   - 1 , 
 
         t i m e r I D :   f a l s e , 
 
         d r a g _ i n :   f a l s e , 
 
         d r a g _ o u t :   f a l s e 
 
 } ; 
 
 
 
 c l i p b o a r d   =   { 
 
         s e l e c t i o n :   n u l l 
 
 } ; 
 
 
 
 c o l u m n s   =   { 
 
         p l a y i c o n :   w i n d o w . G e t P r o p e r t y ( " S Y S T E M . c o l u m n s . p l a y i c o n . e n a b l e d " ,   t r u e ) , 
 
         p l a y i c o n _ x :   0 , 
 
         p l a y i c o n _ w :   0 , 
 
         t r a c k n u m b e r :   w i n d o w . G e t P r o p e r t y ( " S Y S T E M . c o l u m n s . t r a c k n u m b e r . e n a b l e d " ,   t r u e ) , 
 
         t r a c k n u m b e r _ x :   0 , 
 
         t r a c k n u m b e r _ w :   0 , 
 
         t i t l e :   w i n d o w . G e t P r o p e r t y ( " S Y S T E M . c o l u m n s . t i t l e . p a t t e r n " ,   1 ) , 
 
         t i t l e _ x :   0 , 
 
         t i t l e _ w :   0 , 
 
         r a t i n g :   w i n d o w . G e t P r o p e r t y ( " S Y S T E M . c o l u m n s . r a t i n g . e n a b l e d " ,   f a l s e ) , 
 
         r a t i n g _ x :   0 , 
 
         r a t i n g _ w :   0 , 
 
         r a t i n g _ t i m e r I D :   f a l s e , 
 
         r a t i n g _ d r a g :   f a l s e , 
 
         m o o d :   w i n d o w . G e t P r o p e r t y ( " S Y S T E M . c o l u m n s . m o o d . e n a b l e d " ,   f a l s e ) , 
 
         m o o d _ x :   0 , 
 
         m o o d _ w :   0 , 
 
         m o o d _ t i m e r I D :   f a l s e , 
 
         m o o d _ d r a g :   f a l s e , 
 
         b i t r a t e :   w i n d o w . G e t P r o p e r t y ( " S Y S T E M . c o l u m n s . b i t r a t e . e n a b l e d " ,   f a l s e ) , 
 
         b i t r a t e _ x :   0 , 
 
         b i t r a t e _ w :   0 , 
 
         d u r a t i o n _ x :   0 , 
 
         d u r a t i o n _ w :   0 , 
 
         p l a y c o u n t :   w i n d o w . G e t P r o p e r t y ( " S Y S T E M . c o l u m n s . p l a y c o u n t . e n a b l e d " ,   f a l s e ) 
 
 } ; 
 
 
 
 l i s t   =   { 
 
         t h e m e :   f a l s e , 
 
         f i r s t _ l a u n c h :   t r u e , 
 
         t o t a l :   0 , 
 
         t o t a l _ g h :   0 , 
 
         t o t a l _ w i t h _ g h :   0 , 
 
         n b v i s :   0 , 
 
         g r i d x :   0 , 
 
         i t e m :   A r r a y ( ) , 
 
         h l i s t :   A r r a y ( ) , 
 
         e m p t y :   A r r a y ( ) , 
 
         g r o u p s :   A r r a y ( ) , 
 
         c o l l a p s e :   f a l s e , 
 
         h a n d l e l i s t :   n u l l , 
 
         m e t a d b l i s t _ s e l e c t i o n :   p l m a n . G e t P l a y l i s t S e l e c t e d I t e m s ( p l m a n . A c t i v e P l a y l i s t ) , 
 
         f o c u s _ i d :   0 , 
 
         t o c u t :   0 , 
 
         m o u s e w h e e l _ s c r o l l s t e p :   w i n d o w . G e t P r o p e r t y ( " S Y S T E M . m o u s e w h e e l . s c r o l l s t e p " ,   1 ) , 
 
         n o w p l a y i n g :   0 , 
 
         S H I F T _ s t a r t _ i d :   n u l l , 
 
         S H I F T _ c o u n t :   0 , 
 
         i n c _ s e a r c h _ n o r e s u l t :   f a l s e , 
 
         k e y p r e s s e d :   f a l s e , 
 
         b u t t o n c l i c k e d :   f a l s e , 
 
         g r a d i e n t _ l i n e s _ s h o w :   w i n d o w . G e t P r o p e r t y ( " * U S E R . i t e m s . g r a d i e n t . l i n e s " ,   t r u e ) 
 
 } ; 
 
 r o w   =   { 
 
         h :   w i n d o w . G e t P r o p e r t y ( " S Y S T E M . r o w . h e i g h t " ,   3 5 ) , 
 
         p a r i t y :   0 , 
 
         s h o w _ p r o g r e s s :   w i n d o w . G e t P r o p e r t y ( " * U S E R . s h o w . p r o g r e s s . b a r " ,   t r u e ) , 
 
         b u t t o n s _ h o v e r :   f a l s e 
 
 } ; 
 
 g r o u p   =   { 
 
         n b r o w s _ d e f a u l t :   w i n d o w . G e t P r o p e r t y ( " * U S E R . g r o u p . r o w s . n u m b e r " ,   3 ) , 
 
         n b r o w s :   0 , 
 
         m i n _ i t e m _ p e r _ g r o u p :   5 , 
 
         t y p e :   w i n d o w . G e t P r o p e r t y ( " S Y S T E M . g r o u p . t y p e " ,   0 ) , 
 
         k e y :   w i n d o w . G e t P r o p e r t y ( " S Y S T E M . g r o u p   K e y " ,   g r o u p _ p a t t e r n _ a l b u m ) , 
 
         w :   0 
 
 } ; 
 
 t o o l b a r   =   { 
 
         h :   0 , 
 
         l o c k :   w i n d o w . G e t P r o p e r t y ( " S Y S T E M . t o o l b a r . l o c k " ,   f a l s e ) , 
 
         b u t t o n s :   A r r a y ( ) , 
 
         t i m e r I D _ o n :   f a l s e , 
 
         t i m e r I D _ o f f :   f a l s e , 
 
         t i m e r I D 1 :   f a l s e , 
 
         t i m e r I D 2 :   f a l s e , 
 
         c o l l a p s e d _ y :   w i n d o w . G e t P r o p e r t y ( " S Y S T E M . t o o l b a r . s i z e " ,   - 3 0 ) , / / - 2 4 , 
 
         d e l t a :   0 , 
 
         s t e p :   3 , 
 
         s t a t e :   f a l s e 
 
 } ; 
 
 v s c r o l l b a r   =   { 
 
         t h e m e :   f a l s e , 
 
         s h o w :   w i n d o w . G e t P r o p e r t y ( " S Y S T E M . v s c r o l l b a r . v i s i b l e " ,   f a l s e ) , 
 
         v i s i b l e :   t r u e , 
 
         h o v e r :   f a l s e , 
 
         x :   0 , 
 
         y :   0 , 
 
         d e f a u l t _ w :   g e t _ s y s t e m _ s c r o l l b a r _ w i d t h ( ) , 
 
         w :   g e t _ s y s t e m _ s c r o l l b a r _ w i d t h ( ) , 
 
         h :   0 , 
 
         b u t t o n _ t o t a l :   2 , 
 
         d e f a u l t _ s t e p :   w i n d o w . G e t P r o p e r t y ( " S Y S T E M . v s c r o l l b a r . s t e p " ,   3 ) , 
 
         s t e p :   3 , 
 
         a r r _ b u t t o n s :   A r r a y ( ) , 
 
         l e t t e r   :   n u l l 
 
 } ; 
 
 s c r o l l b a r b t   =   { 
 
         t i m e r I D 1 :   f a l s e , 
 
         t i m e r I D 2 :   f a l s e , 
 
         t i m e r 1 _ v a l u e :   4 0 0 , 
 
         t i m e r 2 _ v a l u e :   6 0 
 
 } ; 
 
 b u t t o n _ u p   =   { 
 
         i m g _ n o r m a l :   n u l l , 
 
         i m g _ h o v e r :   n u l l , 
 
         i m g _ d o w n :   n u l l , 
 
         x :   0 , 
 
         y :   0 , 
 
         w :   v s c r o l l b a r . d e f a u l t _ w , 
 
         h :   v s c r o l l b a r . d e f a u l t _ w 
 
 } ; 
 
 b u t t o n _ d o w n   =   { 
 
         i m g _ n o r m a l :   n u l l , 
 
         i m g _ h o v e r :   n u l l , 
 
         i m g _ d o w n :   n u l l , 
 
         x :   0 , 
 
         y :   0 , 
 
         w :   v s c r o l l b a r . d e f a u l t _ w , 
 
         h :   v s c r o l l b a r . d e f a u l t _ w 
 
 } ; 
 
 c u r s o r   =   { 
 
         b t :   n u l l , 
 
         i m g _ n o r m a l :   n u l l , 
 
         i m g _ h o v e r :   n u l l , 
 
         i m g _ d o w n :   n u l l , 
 
         p o p u p :   n u l l , 
 
         x :   0 , 
 
         y :   0 , 
 
         w :   v s c r o l l b a r . d e f a u l t _ w , 
 
         h :   v s c r o l l b a r . d e f a u l t _ w + 3 , 
 
         d e f a u l t _ h :   v s c r o l l b a r . d e f a u l t _ w + 3 , 
 
         h o v e r :   f a l s e , 
 
         d r a g :   f a l s e , 
 
         g r a p _ y :   0 , 
 
         t i m e r I D :   f a l s e , 
 
         l a s t _ y :   0 
 
 } ; 
 
 c o v e r   =   { 
 
         s h o w :   w i n d o w . G e t P r o p e r t y ( " * U S E R . c o v e r . a r t . e n a b l e d " ,   t r u e ) , 
 
         d r a w _ g l a s s _ e f f e c t :   w i n d o w . G e t P r o p e r t y ( " * U S E R . c o v e r . a r t . g l a s s . e f f e c t . e n a b l e d " ,   t r u e ) , 
 
         k e e p a s p e c t r a t i o :   w i n d o w . G e t P r o p e r t y ( " * U S E R . c o v e r . k e e p . a s p e c t . r a t i o " ,   t r u e ) , 
 
         v i s i b l e :   t r u e , 
 
         m a r g i n :   6 , 
 
         w :   0 , 
 
         n b r o w s :   0 , 
 
         h :   0 , 
 
         t o p _ o f f s e t :   0 , 
 
         l o a d _ t i m e r :   f a l s e 
 
 } ; 
 
 
 
 / /   s t a t s   g l o b a l s   ( u s e d   i n   o n _ p l a y b a c k _ t i m e   &   o n _ p l a y b a c k _ n e w _ t r a c k   C a l l b a c k s ) 
 
 s t a t s   =   { 
 
         m e t a d b :   n u l l , 
 
         p a t h _ p r e f i x :   " " , 
 
         t a g g a b l e _ f i l e :   f a l s e , 
 
         e n a b l e d :   w i n d o w . G e t P r o p e r t y ( " S Y S T E M . s t a t i s t i c s . e n a b l e d " ,   f a l s e ) ,   
 
         u p d a t e d :   f a l s e , 
 
         f o o _ p l a y c o u n t :   u t i l s . C h e c k C o m p o n e n t ( " f o o _ p l a y c o u n t " ,   t r u e ) , 
 
         t f _ l e n g t h _ s e c o n d s :   f b . T i t l e F o r m a t ( " % l e n g t h _ s e c o n d s _ f p % " ) , 
 
         t f _ f i r s t _ p l a y e d :   f b . T i t l e f o r m a t ( " % f i r s t _ p l a y e d % " ) , 
 
         t f _ p l a y _ c o u n t e r :   f b . T i t l e f o r m a t ( " % p l a y _ c o u n t e r % " ) , 
 
         t f _ p l a y _ c o u n t :   f b . T i t l e f o r m a t ( " % p l a y _ c o u n t % " ) , 
 
         t i m e _ e l a p s e d :   0 , 
 
         d e l a y :   0 , 
 
         l i m i t :   0 
 
 } ; 
 
 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = / /   P l a y l i s t   l o a d 
 
 f u n c t i o n   r e f r e s h _ s p v _ c u r s o r ( p l s )   { 
 
         
 
         r e s e t _ c o v e r _ t i m e r s ( ) ; 
 
         
 
         / /   R A Z   a c t u a l   l i s t 
 
         l i s t . i t e m . s p l i c e ( 0 ,   l i s t . i t e m . l e n g t h ) ; 
 
         l i s t . t o c u t   =   0 ; 
 
 
 
         / /   c a l c   r a t i o   o f   t h e   s c r o l l   c u r s o r   t o   c a l c   t h e   e q u i v a l e n t   i t e m   f o r   t h e   f u l l   p l a y l i s t   ( w i t h   g h ) 
 
         v a r   r a t i o   =   ( c u r s o r . y - v s c r o l l b a r . y )   /   ( v s c r o l l b a r . h - c u r s o r . h ) ; 
 
         
 
         / /   c a l c   i d x   o f   t h e   i t e m   ( o f   t h e   f u l l   p l a y l i s t   w i t h   g h )   t o   d i s p l a y   a t   t o p   o f   t h e   p a n e l   l i s t   ( v i s i b l e ) 
 
         v a r   i d x   =   M a t h . r o u n d ( ( l i s t . t o t a l _ w i t h _ g h   -   l i s t . n b v i s )   *   r a t i o ) ; 
 
         
 
         / /   s e a r c h   w h a t ' s   t h e   i t e m   t h a t   i s   t h e   f i r s t   t o   d i s p l a y   i n   t h e   l i s t ,   a n d   c a l c   t h e   l i s t . t o c u t   i f   n e e d e d 
 
         v a r   s t a r t _ i d _ m i n   =   M a t h . f l o o r ( i d x   /   ( g r o u p . n b r o w s + 1 ) ) ; 
 
         v a r   b   =   0 ; 
 
         f o r ( v a r   i d   =   s t a r t _ i d _ m i n ;   i d   <   l i s t . t o t a l ;   i d + + )   { 
 
                 b   =   i d   +   ( l i s t . h l i s t [ i d ] * g r o u p . n b r o w s ) ; 
 
                 i f ( b   > =   i d x )   { 
 
                         b r e a k ; 
 
                 } ; 
 
         } ; 
 
         / /   i t e m   ( i d )   i s   f o u n d ,   n o w   w e   c h e c k   h o w   m a n y   l i n e   a r e   t o   c u t   ( c ) ! 
 
         i f ( b   >   i d x )   { 
 
                 v a r   c   =   b   -   g r o u p . n b r o w s ; 
 
                 f o r ( v a r   d   =   1 ;   d   <   g r o u p . n b r o w s + 1 ;   d + + )   { 
 
                         i f ( i d x   = =   c   +   d )   { 
 
                                 l i s t . t o c u t   =   d ; 
 
                                 b r e a k ; 
 
                         } ; 
 
                 } ; 
 
         }   e l s e   i f ( b   = =   i d x )   { 
 
                 i f ( i d = = 0 )   { 
 
                         l i s t . t o c u t   =   g r o u p . n b r o w s ; 
 
                 }   e l s e   { 
 
                         i f ( l i s t . h l i s t [ i d ]   >   l i s t . h l i s t [ i d - 1 ] )   { 
 
                                 l i s t . t o c u t   =   g r o u p . n b r o w s ; 
 
                         }   e l s e   { 
 
                                 l i s t . t o c u t   =   0 ; 
 
                         } ; 
 
                 } ; 
 
         } ; 
 
       
 
         i f ( i d < = 0 )   { 
 
                 i d   =   0 ; 
 
                 v a r   p r e v i o u s _ g r o u p _ k e y   =   n u l l ; 
 
         }   e l s e   { 
 
                 v a r   p r e v i o u s _ g r o u p _ k e y   =   l i s t . h l i s t [ i d - 1 ] ; 
 
         } ; 
 
         
 
         v a r   i   =   i d ; 
 
         v a r   k   =   0 ; 
 
         w h i l e ( i   <   l i s t . t o t a l   & &   k < = l i s t . n b v i s + g r o u p . n b r o w s )   { 
 
                 l i s t . i t e m . p u s h ( n e w   i t e m ( i ,   k ,   0 ) ) ; 
 
                 i f ( g r o u p . n b r o w s > 0 )   { 
 
                         i f ( l i s t . h l i s t [ i ]   ! =   p r e v i o u s _ g r o u p _ k e y )   { 
 
                                 l i s t . i t e m [ k ] . g r i d x   =   1 ; 
 
                                 l i s t . i t e m [ k ] . u p d a t e _ i n f o s ( ) ; 
 
                                 k + + ; 
 
                                 f o r ( v a r   j   =   1 ;   j   <   g r o u p . n b r o w s ;   j + + )   { 
 
                                         l i s t . i t e m . p u s h ( n e w   i t e m ( i ,   k ,   j + 1 ) ) ; 
 
                                         k + + ; 
 
                                 } ; 
 
                                 l i s t . i t e m . p u s h ( n e w   i t e m ( i ,   k ,   0 ) ) ; 
 
                         } ; 
 
                 } ; 
 
                 p r e v i o u s _ g r o u p _ k e y   =   l i s t . h l i s t [ i ] ; 
 
                 k + + ; 
 
                 i + + ; 
 
         } ; 
 
         
 
         / /   a f f e c t   g r o u p   i n d e x   o f   e a c h   t r a c k   o f   e a c h   g r o u p   i n   l i s t . i t e m [ ] 
 
         s e t _ g r p _ i d x _ a l l ( ) ; 
 
 } ; 
 
 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = / /   P l a y l i s t   s c r o l l   d o w n 
 
 f u n c t i o n   s c r o l l d o w n _ s p v ( p l s ,   s t e p )   { 
 
         
 
         i f ( l i s t . i t e m . l e n g t h < = l i s t . n b v i s )   r e t u r n   t r u e ; 
 
         
 
         r e s e t _ c o v e r _ t i m e r s ( ) ; 
 
         
 
         v a r   l a s t _ i t e m _ i d   =   l i s t . i t e m [ l i s t . i t e m . l e n g t h - 1 ] . i d ; 
 
         i f ( l a s t _ i t e m _ i d   > =   l i s t . t o t a l - 1 )   {     / /   d e r n i e r   i t e m   i d   =   l e   d e r n i e r   i d   d e   l a   p l a y l i s t ! 
 
                 v a r   l a s t _ i t e m _ g r i d x   =   l i s t . i t e m [ l i s t . i t e m . l e n g t h - 1 ] . g r i d x ; 
 
                 i f ( l a s t _ i t e m _ g r i d x > 0 )   { 
 
                         v a r   k   =   l i s t . i t e m . l e n g t h ; 
 
                         f o r ( v a r   j = l a s t _ i t e m _ g r i d x + 1 ; j < = g r o u p . n b r o w s ; j + + )   { 
 
                                 l i s t . i t e m . p u s h ( n e w   i t e m ( l a s t _ i t e m _ i d ,   k ,   j ) ) ; 
 
                                 k + + ; 
 
                         } ; 
 
                         l i s t . i t e m . p u s h ( n e w   i t e m ( l a s t _ i t e m _ i d ,   k ,   0 ) ) ; 
 
                 }   e l s e   { 
 
                         / /   i s   l a s t _ i t e m   a l r e a d y   v i s i b l e ?   o t h e r w i s e ,   n o   s c r o l l   t o   d o ,   b o t t o m   r e a c h e d ! 
 
                         v a r   i d x _ l a s t _ i t e m _ v i s   =   l i s t . t o c u t + l i s t . n b v i s - 1 ; 
 
                         i f ( i d x _ l a s t _ i t e m _ v i s > l i s t . i t e m . l e n g t h - 1 )   i d x _ l a s t _ i t e m _ v i s   =   l i s t . i t e m . l e n g t h - 1 ; 
 
                         v a r   l a s t _ i t e m _ v i s _ g r i d x   =   l i s t . i t e m [ i d x _ l a s t _ i t e m _ v i s ] . g r i d x ; 
 
                         i f ( l a s t _ i t e m _ v i s _ g r i d x > 0 )   { 
 
                                 v a r   l a s t _ i t e m _ v i s _ i d   =   l i s t . i t e m [ i d x _ l a s t _ i t e m _ v i s ] . i d   -   1 ; 
 
                         }   e l s e   { 
 
                                 v a r   l a s t _ i t e m _ v i s _ i d   =   l i s t . i t e m [ i d x _ l a s t _ i t e m _ v i s ] . i d ; 
 
                         } ; 
 
                         i f ( l a s t _ i t e m _ v i s _ i d   > =   l a s t _ i t e m _ i d )   { 
 
                                 r e t u r n   t r u e ; 
 
                         }   e l s e   { 
 
                                 / /   s c r o l l   t o   d o   ( n o   n e w   i t e m   t o   a d d   a t   b o t t o m ,   b u t   t o c u t   i n d e x   t o   i n c r e a s e ) 
 
                                 l i s t . t o c u t + + ; 
 
                         } ; 
 
                 } ; 
 
         }   e l s e   { 
 
                 / /   o n   n ' e s t   p a s   s u r   l e   d e r n i e r   i d ,   o n   p e u t   e n   a j o u t e r   u n   a u   t a b l e a u   i t e m ! 
 
                 v a r   l a s t _ i t e m _ g r o u p _ k e y   =   l i s t . h l i s t [ l a s t _ i t e m _ i d ] ; 
 
                 v a r   l a s t _ i t e m _ g r i d x   =   l i s t . i t e m [ l i s t . i t e m . l e n g t h - 1 ] . g r i d x ; 
 
                 
 
                 i f ( l a s t _ i t e m _ g r i d x   >   0 )   { 
 
                         i f ( l a s t _ i t e m _ g r i d x   <   g r o u p . n b r o w s )   { 
 
                                 v a r   n e x t _ i t e m _ i d   =   l a s t _ i t e m _ i d ; 
 
                                 v a r   n e x t _ i t e m _ g r i d x   =   l a s t _ i t e m _ g r i d x   +   1 ; 
 
                         }   e l s e   { 
 
                                 v a r   n e x t _ i t e m _ i d   =   l a s t _ i t e m _ i d ; 
 
                                 v a r   n e x t _ i t e m _ g r i d x   =   0 ; 
 
                         } ; 
 
                 }   e l s e   { 
 
                         v a r   n e x t _ i t e m _ i d   =   l a s t _ i t e m _ i d   +   1 ; 
 
                         i f ( l i s t . h l i s t [ n e x t _ i t e m _ i d ]   ! =   l a s t _ i t e m _ g r o u p _ k e y )   { 
 
                                 i f ( g r o u p . n b r o w s > 0 )   { 
 
                                         v a r   n e x t _ i t e m _ g r i d x   =   1 ; 
 
                                 }   e l s e   { 
 
                                         v a r   n e x t _ i t e m _ g r i d x   =   0 ; 
 
                                 } ; 
 
                         }   e l s e   { 
 
                                 v a r   n e x t _ i t e m _ g r i d x   =   0 ; 
 
                         } ; 
 
                 } ; 
 
                 / /   a d d   t h e   n e x t   i t e m   ( n e w   o n e )   t o   t h e   a r r a y 
 
                 l i s t . i t e m . p u s h ( n e w   i t e m ( n e x t _ i t e m _ i d ,   l i s t . i t e m . l e n g t h ,   n e x t _ i t e m _ g r i d x ) ) ; 
 
                 i f ( l i s t . i t e m [ l i s t . i t e m . l e n g t h - 2 ] . g r i d x > 0 )   { 
 
                         l i s t . i t e m [ l i s t . i t e m . l e n g t h - 1 ] . g r p _ i d x   =   0 ; 
 
                 }   e l s e   { 
 
                         l i s t . i t e m [ l i s t . i t e m . l e n g t h - 1 ] . g r p _ i d x   =   l i s t . i t e m [ l i s t . i t e m . l e n g t h - 2 ] . g r p _ i d x   +   1 ; 
 
                 } ; 
 
                 / /   r e m o v e   t h e   f i r s t   i t e m   o f   t h e   a r r a y ,   t o   a l w a y s   k e e p   t h e   s a m e   n u m b e r   o f   i t e m s   i n   t h e   A r r a y 
 
                 l i s t . i t e m . s h i f t ( ) ; 
 
         } ; 
 
         
 
         v a r   l e n   =   l i s t . i t e m . l e n g t h ; 
 
         f o r ( v a r   i = 0 ;   i < l e n ;   i + + )   { 
 
                 l i s t . i t e m [ i ] . i d x   =   i ; 
 
                 l i s t . i t e m [ i ] . d e f a u l t y   =   t o o l b a r . h   +   i   *   r o w . h ; 
 
                 l i s t . i t e m [ i ] . y   =   l i s t . i t e m [ i ] . d e f a u l t y   -   ( l i s t . t o c u t   *   r o w . h ) ; 
 
         } ; 
 
                     
 
         s e t c u r s o r y ( ) ; 
 
 
 
 } ; 
 
 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = / /   P l a y l i s t   s c r o l l   u p 
 
 f u n c t i o n   s c r o l l u p _ s p v ( p l s ,   s t e p )   { 
 
 
 
         i f ( l i s t . i t e m . l e n g t h < l i s t . n b v i s )   r e t u r n   t r u e ; 
 
         
 
         r e s e t _ c o v e r _ t i m e r s ( ) ; 
 
         
 
         v a r   f i r s t _ i t e m _ i d   =   l i s t . i t e m [ 0 ] . i d ; 
 
         
 
         i f ( f i r s t _ i t e m _ i d   < =   0 )   { 
 
                 / /   i s   t h e   f i r s t   i d   a l r e a d y   v i s i b l e ?   o t h e r w i s e ,   n o   s c r o l l   t o   d o ,   t o p   o f   t h e   l i s t   i s   a l r e a d y   r e a c h e d ! 
 
                 v a r   f i r s t _ i t e m _ v i s _ i d   =   l i s t . i t e m [ l i s t . t o c u t ] . i d ; 
 
                 i f ( f i r s t _ i t e m _ i d   > =   f i r s t _ i t e m _ v i s _ i d )   { 
 
                         i f ( g r o u p . n b r o w s   >   0 )   { 
 
                                 v a r   f i r s t _ i t e m _ g r i d x   =   l i s t . i t e m [ 0 ] . g r i d x ; 
 
                                 i f ( f i r s t _ i t e m _ g r i d x = = 1 )   { 
 
                                         i f ( l i s t . t o c u t = = 0 )   { 
 
                                                 r e t u r n   t r u e ; 
 
                                         }   e l s e   { 
 
                                                 l i s t . t o c u t - - ; 
 
                                         } ; 
 
                                 }   e l s e   { 
 
                                         / /   p r e v   i t e m   t o   a d d   t o   c o m p l e t e   t h e   g r o u p   h e a d e r   o f   t h e   f i r s t   i t e m 
 
                                         v a r   p r e v _ i t e m _ i d   =   f i r s t _ i t e m _ i d ; 
 
                                         v a r   p r e v _ i t e m _ g r i d x   =   ( f i r s t _ i t e m _ g r i d x = = 0 )   ?   g r o u p . n b r o w s   :   f i r s t _ i t e m _ g r i d x   -   1 ; 
 
                                         / /   a d d   t h e   n e x t   i t e m   ( n e w   o n e )   t o   t h e   a r r a y 
 
                                         l i s t . i t e m . u n s h i f t ( n e w   i t e m ( p r e v _ i t e m _ i d ,   0 ,   p r e v _ i t e m _ g r i d x ) ) ; 
 
                                         / /   s e t   g r o u p   i n d e x   v a l u e   o f   t h e   n e w   i t e m 
 
                                         i f ( p r e v _ i t e m _ g r i d x > 0 )   { 
 
                                                 l i s t . i t e m [ 0 ] . g r p _ i d x   =   0 ; 
 
                                         }   e l s e   { 
 
                                                 i f ( l i s t . i t e m [ 1 ] . g r i d x > 0 )   { 
 
                                                         s e t _ g r p _ i d x _ f i r s t ( ) ; 
 
                                                 }   e l s e   { 
 
                                                         l i s t . i t e m [ 0 ] . g r p _ i d x   =   l i s t . i t e m [ 1 ] . g r p _ i d x   -   1 ; 
 
                                                 } ; 
 
                                         } ; 
 
                                         / /   r e m o v e   t h e   l a s t   i t e m   o f   t h e   a r r a y ,   t o   a l w a y s   k e e p   t h e   s a m e   n u m b e r   o f   i t e m s   i n   t h e   A r r a y 
 
                                         l i s t . i t e m . p o p ( ) ; 
 
                                 } ; 
 
                         } ; 
 
                 }   e l s e   { 
 
                         / /   s c r o l l   t o   d o   ( n o   n e w   i t e m   t o   a d d   a t   t o p ,   b u t   t o c u t   i n d e x   t o   d e c r e a s e ) 
 
                         l i s t . t o c u t - - ; 
 
                 } ; 
 
         }   e l s e   { 
 
                 i f ( l i s t . t o c u t > g r o u p . n b r o w s )   { 
 
                         l i s t . t o c u t - - ; 
 
                 }   e l s e   { 
 
                         / /   o n   n ' e s t   p a s   s u r   l e   p r e m i e r   i d ,   o n   p e u t   e n   a j o u t e r   u n   a u   t a b l e a u   i t e m ! 
 
                         v a r   f i r s t _ i t e m _ g r o u p _ k e y   =   l i s t . h l i s t [ l i s t . i t e m [ 0 ] . i d ] ; 
 
                         v a r   f i r s t _ i t e m _ g r i d x   =   l i s t . i t e m [ 0 ] . g r i d x ; 
 
                         
 
                         i f ( f i r s t _ i t e m _ g r i d x   >   0 )   { 
 
                                 i f ( f i r s t _ i t e m _ g r i d x   = =   1 )   { 
 
                                         v a r   p r e v _ i t e m _ i d   =   f i r s t _ i t e m _ i d   -   1 ; 
 
                                         v a r   p r e v _ i t e m _ g r i d x   =   0 ; 
 
                                 }   e l s e   { 
 
                                         v a r   p r e v _ i t e m _ i d   =   f i r s t _ i t e m _ i d ; 
 
                                         v a r   p r e v _ i t e m _ g r i d x   =   f i r s t _ i t e m _ g r i d x   -   1 ; 
 
                                 } ; 
 
                         }   e l s e   { 
 
                                 v a r   p r e v _ i t e m _ i d   =   f i r s t _ i t e m _ i d   -   1 ; 
 
                                 i f ( l i s t . h l i s t [ p r e v _ i t e m _ i d ]   ! =   f i r s t _ i t e m _ g r o u p _ k e y )   { 
 
                                         i f ( g r o u p . n b r o w s > 0 )   { 
 
                                                 p r e v _ i t e m _ i d   =   f i r s t _ i t e m _ i d ; 
 
                                                 p r e v _ i t e m _ g r i d x   =   g r o u p . n b r o w s ; 
 
                                         }   e l s e   { 
 
                                                 p r e v _ i t e m _ g r i d x   =   0 ; 
 
                                         } ; 
 
                                 }   e l s e   { 
 
                                         p r e v _ i t e m _ g r i d x   =   0 ; 
 
                                 } ; 
 
                         } ; 
 
                         / /   a d d   t h e   n e x t   i t e m   ( n e w   o n e )   t o   t h e   a r r a y 
 
                         l i s t . i t e m . u n s h i f t ( n e w   i t e m ( p r e v _ i t e m _ i d ,   0 ,   p r e v _ i t e m _ g r i d x ) ) ; 
 
                         / /   s e t   g r o u p   i n d e x   v a l u e   o f   t h e   n e w   i t e m 
 
                         i f ( p r e v _ i t e m _ g r i d x > 0 )   { 
 
                                 l i s t . i t e m [ 0 ] . g r p _ i d x   =   0 ; 
 
                         }   e l s e   { 
 
                                 i f ( l i s t . i t e m [ 1 ] . g r i d x > 0 )   { 
 
                                         s e t _ g r p _ i d x _ f i r s t ( ) ; 
 
                                 }   e l s e   { 
 
                                         l i s t . i t e m [ 0 ] . g r p _ i d x   =   l i s t . i t e m [ 1 ] . g r p _ i d x   -   1 ; 
 
                                 } ; 
 
                         } ; 
 
                         / /   r e m o v e   t h e   l a s t   i t e m   o f   t h e   a r r a y ,   t o   a l w a y s   k e e p   t h e   s a m e   n u m b e r   o f   i t e m s   i n   t h e   A r r a y 
 
                         i f ( l i s t . i t e m . l e n g t h   -   l i s t . t o c u t   >   l i s t . n b v i s + 1 + g r o u p . n b r o w s )   { 
 
                                 l i s t . i t e m . p o p ( ) ; 
 
                         } ; 
 
                 } ; 
 
         } ; 
 
         
 
         v a r   l e n   =   l i s t . i t e m . l e n g t h ; 
 
         f o r ( i = 0 ; i < l e n ; i + + )   { 
 
                 l i s t . i t e m [ i ] . i d x   =   i ; 
 
                 l i s t . i t e m [ i ] . d e f a u l t y   =   t o o l b a r . h   +   i   *   r o w . h ; 
 
                 l i s t . i t e m [ i ] . y   =   l i s t . i t e m [ i ] . d e f a u l t y   -   ( l i s t . t o c u t   *   r o w . h ) ; 
 
         } ; 
 
                       
 
         s e t c u r s o r y ( ) ; 
 
 } ; 
 
 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = / /   P l a y l i s t   l o a d 
 
 f u n c t i o n   r e f r e s h _ s p v ( p l s ,   f o r c e )   { 
 
         
 
         v a r   n b v i s   =   M a t h . c e i l ( ( w h - t o o l b a r . h ) / r o w . h ) ; 
 
         v a r   m i d _ n b v i s   =   M a t h . r o u n d ( n b v i s   /   2 )   -   1 ; 
 
         
 
         g _ t o o l t i p . T e x t = " " ; 
 
         
 
         r e s e t _ c o v e r _ t i m e r s ( ) ; 
 
                           
 
         / /   t e s t   i f   c e n t e r   f o c u s   i t e m   r e q u i r e d       
 
         i f ( ! f o r c e   & &   l i s t . i t e m . l e n g t h > 0 )   { 
 
                 v a r   v i s _ m i n _ i d x   =   l i s t . i t e m [ l i s t . t o c u t ] . i d ; 
 
                 v a r   d e l t a 2 m a x   =   ( l i s t . t o c u t + l i s t . n b v i s )   -   1 ; 
 
                 i f ( d e l t a 2 m a x < l i s t . i t e m . l e n g t h )   { 
 
                         v i s _ m a x _ i d x   =   ( l i s t . i t e m [ d e l t a 2 m a x ] . g r i d x = = 0 )   ?   l i s t . i t e m [ d e l t a 2 m a x ] . i d   :   ( l i s t . i t e m [ d e l t a 2 m a x ] . i d   -   1 ) ; 
 
                 }   e l s e   { 
 
                         v i s _ m a x _ i d x   =   l i s t . i t e m [ l i s t . i t e m . l e n g t h - 1 ] . i d ; 
 
                 } ; 
 
                 i f ( l i s t . f o c u s _ i d > = v i s _ m i n _ i d x   & &   l i s t . f o c u s _ i d < = v i s _ m a x _ i d x )   { 
 
                         i f ( b u t t o n _ u p . t i m e r I D   & &   l i s t . f o c u s _ i d = = 0   & &   l i s t . i t e m [ l i s t . t o c u t ] . g r i d x ! = 1 )   { 
 
                                 
 
                         }   e l s e   { 
 
                                 r e t u r n   t r u e ; 
 
                         } ; 
 
                 } ; 
 
         } ; 
 
         
 
         v a r   m ; 
 
         v a r   f o c u s _ i d x   =   0 ; 
 
         l i s t . t o c u t   =   0 ; 
 
 
 
         / /   R A Z   a c t u a l   l i s t 
 
         l i s t . i t e m . s p l i c e ( 0 ,   l i s t . i t e m . l e n g t h ) ; 
 
         
 
         i f ( l i s t . t o t a l < = 0 )   r e t u r n   t r u e ; 
 
         
 
         v a r   r   =   l i s t . f o c u s _ i d   -   l i s t . n b v i s ; 
 
         i f ( r < = 0 )   { 
 
                 r   =   0 ; 
 
                 v a r   p r e v i o u s _ g r o u p _ k e y   =   n u l l ; 
 
         }   e l s e   { 
 
                 v a r   p r e v i o u s _ g r o u p _ k e y   =   l i s t . h l i s t [ r - 1 ] ; 
 
         } ; 
 
         
 
         v a r   i   =   r ; 
 
         v a r   k   =   0 ; 
 
 
 
         w h i l e ( i   <   l i s t . t o t a l   & &   k < = ( ( g r o u p . n b r o w s > 0 ? ( l i s t . n b v i s * g r o u p . n b r o w s ) : l i s t . n b v i s ) * 2 ) )   { 
 
                 l i s t . i t e m . p u s h ( n e w   i t e m ( i ,   k ,   0 ) ) ; 
 
                 i f ( g r o u p . n b r o w s > 0 )   { 
 
                         i f ( l i s t . h l i s t [ i ]   ! =   p r e v i o u s _ g r o u p _ k e y )   { 
 
                                 l i s t . i t e m [ k ] . g r i d x   =   1 ; 
 
                                 l i s t . i t e m [ k ] . u p d a t e _ i n f o s ( ) ; 
 
                                 k + + ; 
 
                                 f o r ( v a r   g = 1 ; g < g r o u p . n b r o w s ; g + + )   { 
 
                                         l i s t . i t e m . p u s h ( n e w   i t e m ( i ,   k ,   g + 1 ) ) ; 
 
                                         k + + ; 
 
                                 } ; 
 
                                 l i s t . i t e m . p u s h ( n e w   i t e m ( i ,   k ,   0 ) ) ; 
 
                         } ; 
 
                 } ; 
 
                 i f ( l i s t . i t e m [ k ] . i d   = =   l i s t . f o c u s _ i d )   f o c u s _ i d x   =   k ; 
 
                 p r e v i o u s _ g r o u p _ k e y   =   l i s t . h l i s t [ i ] ; 
 
                 k + + ; 
 
                 i + + ; 
 
         } ; 
 
         
 
         / /   c a l c   v a l u e   o f   l i s t . t o c u t 
 
         i f ( l i s t . i t e m . l e n g t h < = l i s t . n b v i s )   { 
 
                 l i s t . t o c u t   =   0 ; 
 
         }   e l s e   { 
 
                 l i s t . t o c u t   =   f o c u s _ i d x   -   m i d _ n b v i s ; 
 
                 i f ( l i s t . t o c u t < = 0 )   { 
 
                         l i s t . t o c u t   =   0 ; 
 
                 } ; 
 
                 i f ( f o c u s _ i d x + m i d _ n b v i s + 1 > l i s t . i t e m . l e n g t h - 1 )   { 
 
                         l i s t . t o c u t   =   l i s t . i t e m . l e n g t h   -   l i s t . n b v i s ; 
 
                 } ; 
 
         } ; 
 
         
 
         / /   a f f e c t   g r o u p   i n d e x   o f   e a c h   t r a c k   o f   e a c h   g r o u p   i n   l i s t . i t e m [ ] 
 
         s e t _ g r p _ i d x _ a l l ( ) ; 
 
 
 
         i f ( v s c r o l l b a r . s h o w )   { 
 
                 i f ( l i s t . i t e m . l e n g t h < = l i s t . n b v i s )   v s c r o l l b a r . v i s i b l e   =   f a l s e ;   e l s e   v s c r o l l b a r . v i s i b l e = t r u e ; 
 
         }   e l s e   { 
 
                 v s c r o l l b a r . v i s i b l e   =   f a l s e ; 
 
         } ; 
 
             
 
         v a r   r a t i o   =   l i s t . n b v i s   /   l i s t . t o t a l _ w i t h _ g h ; 
 
         i f ( r a t i o > 1 )   r a t i o   =   1 ; 
 
         c u r s o r . h   =   M a t h . r o u n d ( r a t i o   *   v s c r o l l b a r . h ) ; 
 
         / /   b o u n d a r i e s   f o r   c u r s o r   h e i g h t 
 
         i f ( c u r s o r . h > v s c r o l l b a r . h )   c u r s o r . h   =   v s c r o l l b a r . h ; 
 
         i f ( c u r s o r . h < c u r s o r . d e f a u l t _ h )   c u r s o r . h   =   c u r s o r . d e f a u l t _ h ; 
 
         / /   r e d r a w   c u r s o r   i m a g e 
 
         s e t _ s c r o l l e r ( ) ; 
 
         / /   s e t   c u r s o r   p o s i t i o n 
 
         s e t c u r s o r y ( ) ; 
 
 
 
 } ; 
 
 
 
 f u n c t i o n   s e t _ g r p _ i d x _ a l l ( )   { 
 
         
 
         i f ( l i s t . i t e m . l e n g t h < = 0 )   r e t u r n   t r u e ; 
 
         
 
         i f ( g r o u p . n b r o w s > 0 )   { 
 
                 v a r   i d   =   l i s t . i t e m [ 0 ] . i d ; 
 
                 v a r   k e y 1   =   l i s t . h l i s t [ i d ] ; 
 
                 v a r   k e y 2   =   n u l l ; 
 
                 v a r   g r p _ i d x   =   0 ; 
 
                 i f ( l i s t . i t e m [ 0 ] . g r i d x = = 0 )   { 
 
                         w h i l e ( i d > 0 )   { 
 
                                 k e y 2   =   l i s t . h l i s t [ i d - 1 ] ; 
 
                                 i f ( k e y 2   ! =   k e y 1 )   { 
 
                                         i d   =   0 ; 
 
                                 }   e l s e   { 
 
                                         g r p _ i d x + + ; 
 
                                 } ; 
 
                                 i d - - ; 
 
                         } ; 
 
                 } ; 
 
                 i d   =   l i s t . i t e m [ 0 ] . i d ; 
 
                 f o r ( v a r   i = 0 ;   i   <   l i s t . i t e m . l e n g t h ;   i + + )   { 
 
                         i f ( l i s t . i t e m [ i ] . g r i d x = = 0 )   { 
 
                                 l i s t . i t e m [ i ] . g r p _ i d x   =   g r p _ i d x ; 
 
                                 g r p _ i d x + + ; 
 
                         }   e l s e   { 
 
                                 l i s t . i t e m [ i ] . g r p _ i d x   =   0 ; 
 
                                 g r p _ i d x   =   0 ; 
 
                         } ; 
 
                 } ; 
 
         }   e l s e   { 
 
                 f o r ( v a r   i = 0 ;   i   <   l i s t . i t e m . l e n g t h ;   i + + )   { 
 
                         l i s t . i t e m [ i ] . g r p _ i d x   =   l i s t . i t e m [ i ] . i d ; 
 
                 } ; 
 
         } ; 
 
 } ; 
 
 
 
 f u n c t i o n   s e t _ g r p _ i d x _ f i r s t ( )   { 
 
         
 
         i f ( l i s t . i t e m . l e n g t h < = 0 )   r e t u r n   t r u e ; 
 
         
 
         i f ( g r o u p . n b r o w s > 0 )   { 
 
                 v a r   i d   =   l i s t . i t e m [ 0 ] . i d ; 
 
                 v a r   k e y 1   =   l i s t . h l i s t [ i d ] ; 
 
                 v a r   k e y 2   =   n u l l ; 
 
                 v a r   g r p _ i d x   =   0 ; 
 
                 i f ( l i s t . i t e m [ 0 ] . g r i d x = = 0 )   { 
 
                         w h i l e ( i d > 0 )   { 
 
                                 k e y 2   =   l i s t . h l i s t [ i d - 1 ] ; 
 
                                 i f ( k e y 2   ! =   k e y 1 )   { 
 
                                         i d   =   0 ; 
 
                                 }   e l s e   { 
 
                                         g r p _ i d x + + ; 
 
                                 } ; 
 
                                 i d - - ; 
 
                         } ; 
 
                         l i s t . i t e m [ 0 ] . g r p _ i d x   =   g r p _ i d x ; 
 
                 }   e l s e   { 
 
                         l i s t . i t e m [ 0 ] . g r p _ i d x   =   0 ; 
 
                 } ; 
 
         }   e l s e   { 
 
                 f o r ( v a r   i = 0 ;   i   <   l i s t . i t e m . l e n g t h ;   i + + )   { 
 
                         l i s t . i t e m [ i ] . g r p _ i d x   =   l i s t . i t e m [ i ] . i d ; 
 
                 } ; 
 
         } ; 
 
 } ; 
 
 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = / /   O f f s e t   c a l c u l a t i o n s 
 
 f u n c t i o n   s e t c u r s o r y ( )   { 
 
         i f ( l i s t . i t e m . l e n g t h < = l i s t . n b v i s )   { 
 
                 c u r s o r . y   =   v s c r o l l b a r . y ; 
 
         }   e l s e   i f ( l i s t . i t e m . l e n g t h > l i s t . t o c u t ) {             
 
                 v a r   f i r s t _ i d   =   l i s t . i t e m [ l i s t . t o c u t ] . i d ; 
 
                 i f ( l i s t . i t e m [ l i s t . t o c u t ] . g r i d x   = =   0 )   { 
 
                         v a r   r a t i o   =   ( f i r s t _ i d   +   ( ( l i s t . h l i s t [ f i r s t _ i d ] - 0 )   *   g r o u p . n b r o w s ) )   /   ( l i s t . t o t a l _ w i t h _ g h - l i s t . n b v i s ) ; 
 
                 }   e l s e   { 
 
                         v a r   r a t i o   =   ( f i r s t _ i d   +   ( ( l i s t . h l i s t [ f i r s t _ i d ] - 0 )   *   g r o u p . n b r o w s )   -   ( g r o u p . n b r o w s + 1 - l i s t . i t e m [ l i s t . t o c u t ] . g r i d x )     )   /   ( l i s t . t o t a l _ w i t h _ g h - l i s t . n b v i s ) ; 
 
                 } ; 
 
                 i f ( r a t i o < 0 )   r a t i o   =   0 ; 
 
                 i f ( r a t i o > 1 )   r a t i o   =   1 ; 
 
                 c u r s o r . y   =   v s c r o l l b a r . y   +   M a t h . r o u n d ( ( v s c r o l l b a r . h - c u r s o r . h )   *   r a t i o ) ; 
 
         } ; 
 
 } ; 
 
 
 
 f u n c t i o n   i n i t _ a c t i v e _ p l s ( )   { 
 
         v a r   t e m p _ k e y 1 ; 
 
         v a r   t e m p _ k e y 2 ; 
 
         v a r   g h _ c o u n t   =   0 ; 
 
         v a r   e m p t y   =   0 ; 
 
         v a r   c o u n t   =   0 ; 
 
         v a r   g r p _ l e n g t h   =   0 ; 
 
         v a r   m e t a d b ; 
 
               
 
         / / v a r   d 1   =   n e w   D a t e ( ) ; 
 
         / / v a r   t 1   =   d 1 . g e t S e c o n d s ( ) * 1 0 0 0   +   d 1 . g e t M i l l i s e c o n d s ( ) ; 
 
         / / f b . t r a c e ( " a v a n t = " + t 1 ) ; 
 
         
 
         l i s t . h l i s t . s p l i c e ( 0 ,   l i s t . h l i s t . l e n g t h ) ; 
 
         l i s t . e m p t y . s p l i c e ( 0 ,   l i s t . e m p t y . l e n g t h ) ; 
 
         l i s t . g r o u p s . s p l i c e ( 0 ,   l i s t . g r o u p s . l e n g t h ) ; 
 
         
 
         i f ( l i s t . h a n d l e l i s t )   l i s t . h a n d l e l i s t . D i s p o s e ( ) ; 
 
         l i s t . h a n d l e l i s t   =   p l m a n . G e t P l a y l i s t I t e m s ( p l m a n . A c t i v e P l a y l i s t ) ; 
 
         l i s t . t o t a l   =   l i s t . h a n d l e l i s t . C o u n t ; 
 
                 
 
         i f ( g r o u p . n b r o w s > 0 )   { 
 
                 f o r   ( v a r   i   =   0 ;   i   <   l i s t . t o t a l ;   i + + )   { 
 
                         m e t a d b   =   l i s t . h a n d l e l i s t . I t e m ( i ) ; 
 
                         t e m p _ k e y 2   =   t f _ g r o u p _ k e y . E v a l W i t h M e t a d b ( m e t a d b ) ; 
 
                         i f ( t e m p _ k e y 1   ! =   t e m p _ k e y 2 ) { 
 
                                 i f ( i > 0 )   { 
 
                                         l i s t . g r o u p s . p u s h ( c o u n t ) ; 
 
                                 } ; 
 
                                 / / l i s t . g r o u p s . p u s h ( l i s t . c o l l a p s e ) ; 
 
                                 i f ( i > 0   & &   c o u n t < g r o u p . m i n _ i t e m _ p e r _ g r o u p )   { 
 
                                         e m p t y   + =   ( g r o u p . m i n _ i t e m _ p e r _ g r o u p   -   c o u n t ) ; 
 
                                 } ; 
 
                                 c o u n t   =   0 ; 
 
                                 / / g r p _ l e n g t h   =   0 ; 
 
                                 g h _ c o u n t + + ; 
 
                                 t e m p _ k e y 1   =   t e m p _ k e y 2 ; 
 
                         } ; 
 
                         c o u n t + + ; 
 
                         / / g r p _ l e n g t h   + =   m e t a d b . L e n g t h ; 
 
                         l i s t . h l i s t . p u s h ( g h _ c o u n t ) ; 
 
                         l i s t . e m p t y . p u s h ( e m p t y ) ; 
 
                         / /   o n   l a s t   i t e m 
 
                         i f ( i   = =   l i s t . t o t a l - 1 )   { 
 
                                 l i s t . g r o u p s . p u s h ( c o u n t ) ; 
 
                         } ; 
 
                 } ; 
 
         }   e l s e   { 
 
                 f o r   ( v a r   i   =   0 ;   i   <   l i s t . t o t a l ;   i + + )   { 
 
                         l i s t . h l i s t . p u s h ( 0 ) ; 
 
                         l i s t . e m p t y . p u s h ( 0 ) ; 
 
                 } ; 
 
         } ; 
 
         l i s t . t o t a l _ g h   =   g h _ c o u n t ; 
 
         l i s t . t o t a l _ w i t h _ g h   =   l i s t . t o t a l   +   ( l i s t . t o t a l _ g h   *   g r o u p . n b r o w s ) ; 
 
         
 
         / / v a r   d 2   =   n e w   D a t e ( ) ; 
 
         / / v a r   t 2   =   d 2 . g e t S e c o n d s ( ) * 1 0 0 0   +   d 2 . g e t M i l l i s e c o n d s ( ) ; 
 
         / / f b . t r a c e ( " p l   o l d   a p r e s = " + t 2 + "   = = >   d e l t a   =   " + M a t h . r o u n d ( t 2 - t 1 ) + "   / l i s t . h l i s t . l e n g t h = " + l i s t . h l i s t . l e n g t h ) ; 
 
 } ; 
 
 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = / /   C o l o u r   &   F o n t   C a l l b a c k s 
 
 f u n c t i o n   o n _ f o n t _ c h a n g e d ( )   { 
 
         g e t _ f o n t ( ) ; 
 
         c o l u m n s . d u r a t i o n _ w   =   0 ; 
 
         c o l u m n s . b i t r a t e _ w   =   0 ; 
 
         r e f r e s h _ s p v ( p l m a n . A c t i v e P l a y l i s t ,   t r u e ) ; 
 
         w i n d o w . R e p a i n t ( ) ; 
 
 } ; 
 
 
 
 f u n c t i o n   o n _ c o l o r s _ c h a n g e d ( )   { 
 
         g e t _ c o l o r s ( ) ; 
 
         i n i t _ i c o n s ( ) ; 
 
         r e d r a w _ s t u b _ i m a g e s ( ) ; 
 
         i n i t _ v s c r o l l b a r _ b u t t o n s ( ) ; 
 
         s e t _ s c r o l l e r ( ) ; 
 
         g _ i m a g e _ c a c h e   =   n e w   i m a g e _ c a c h e ; 
 
         C o l l e c t G a r b a g e ( ) ; 
 
         w i n d o w . R e p a i n t ( ) ; 
 
 } ; 
 
 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = / /   I n i t 
 
 f u n c t i o n   o n _ i n i t ( )   {       
 
         t f _ g r o u p _ k e y   =   f b . T i t l e F o r m a t ( g r o u p . k e y ) ; 
 
 } ; 
 
 o n _ i n i t ( ) ; 
 
 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = / /   O n S i z e 
 
 f u n c t i o n   o n _ s i z e ( )   { 
 
         i f   ( ! w i n d o w . W i d t h   | |   ! w i n d o w . H e i g h t )   r e t u r n ; 
 
         
 
         w i n d o w . D l g C o d e   =   D L G C _ W A N T A L L K E Y S ; 
 
         
 
         b o o l _ o n _ s i z e   =   t r u e ; 
 
         
 
         i f ( g _ i n s t a n c e t y p e   = =   0 )   {   / /   C U I 
 
                 w i n d o w . M i n W i d t h   =   2 0 0 ; 
 
                 w i n d o w . M i n H e i g h t   =   1 0 0 ;     
 
         }   e l s e   i f ( g _ i n s t a n c e t y p e   = =   1 )   {   / /   D U I 
 
                 w i n d o w . M i n W i d t h   =   2 0 0 ; 
 
                 w i n d o w . M i n H e i g h t   =   1 0 0 ; 
 
         } ; 
 
         
 
         w w   =   w i n d o w . W i d t h ; 
 
         w h   =   w i n d o w . H e i g h t ; 
 
         
 
         i f ( w h < 1 0 0 )   w h   =   1 0 0 ; 
 
         
 
         / /   s e t   w a l l p a p e r 
 
         / / p a n e l . w a l l p a p e r _ i m g   =   F o r m a t W P ( g d i . I m a g e ( p a n e l . w a l l p a p e r _ p a t h ) ,   w w ,   w h ) ; 
 
         
 
         / /   s e t   w a l l p a p e r 
 
         i f ( f b . I s P l a y i n g )   { 
 
                 g _ w a l l p a p e r I m g   =   s e t W a l l p a p e r I m g ( p p t . w a l l p a p e r p a t h ,   f b . G e t N o w P l a y i n g ( ) ) ; 
 
         } ;   e l s e   { 
 
                 / / g _ w a l l p a p e r I m g   =   n u l l ; 
 
                 g _ w a l l p a p e r I m g   =   s e t W a l l p a p e r I m g ( p p t . w a l l p a p e r p a t h ,   f b . G e t N o w P l a y i n g ( ) ) ; 
 
         } ; 
 
         
 
         g e t _ f o n t ( ) ; 
 
         g e t _ c o l o r s ( ) ; 
 
         i n i t _ i c o n s ( ) ; 
 
         
 
         r e c a l c _ d a t a s ( ) ; 
 
         r e d r a w _ s t u b _ i m a g e s ( ) ; 
 
               
 
         / /   o n l y   o n   f i r s t   l a u n c h 
 
         i f ( l i s t . f i r s t _ l a u n c h )   { 
 
                 l i s t . f i r s t _ l a u n c h   =   f a l s e ; 
 
                 o n _ p l a y l i s t _ s w i t c h ( ) ; 
 
         }   e l s e   { 
 
                 / /   i f   j u s t   a   w i n d o w   r e s i z e ,   r e f r e s h   l i s t . i t e m   a n d   r e p a i n t   : ) 
 
                 r e f r e s h _ s p v ( p l m a n . A c t i v e P l a y l i s t ,   t r u e ) ; 
 
                 v s c r o l l b a r . w   =   v s c r o l l b a r . v i s i b l e ? v s c r o l l b a r . d e f a u l t _ w : 0 ; 
 
                 w i n d o w . R e p a i n t ( ) ; 
 
         } 
 
 } ; 
 
 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = / /   O n P a i n t 
 
 f u n c t i o n   o n _ p a i n t ( g r )   { 
 
     
 
 / /   d e f a u l t   b a c k g r o u n d 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 ! w i n d o w . I s T r a n s p a r e n t   & &   ! p p t . s h o w w a l l p a p e r   & &   g r . F i l l S o l i d R e c t ( 0 ,   0 ,   w w ,   w h ,   p p t . b a c k g r o u n d _ c o l o r ) ; 
 
   
 
         i f ( f b . I s P l a y i n g   & &   g _ w a l l p a p e r I m g   & &   p p t . s h o w w a l l p a p e r )   { 
 
                         g r . G d i D r a w B i t m a p ( g _ w a l l p a p e r I m g ,   0 ,   0 ,   w w ,   w h ,   0 ,   0 ,   g _ w a l l p a p e r I m g . W i d t h ,   g _ w a l l p a p e r I m g . H e i g h t ) ; 
 
                         g r . F i l l S o l i d R e c t ( 0 ,   0 ,   w w ,   w h ,   g _ c o l o r _ n o r m a l _ b g   &   R G B A ( 2 5 5 , 2 5 5 , 2 5 5 , p p t . w a l l p a p e r a l p h a ) ) ; 
 
                 } ;   e l s e   { 
 
                         i f ( g _ w a l l p a p e r I m g   & &   p p t . s h o w w a l l p a p e r )   { 
 
                                 g r . G d i D r a w B i t m a p ( g _ w a l l p a p e r I m g ,   0 ,   0 ,   w w ,   w h ,   0 ,   0 ,   g _ w a l l p a p e r I m g . W i d t h ,   g _ w a l l p a p e r I m g . H e i g h t ) ; 
 
                                 g r . F i l l S o l i d R e c t ( 0 ,   0 ,   w w ,   w h ,   g _ c o l o r _ n o r m a l _ b g   &   R G B A ( 2 5 5 , 2 5 5 , 2 5 5 , p p t . w a l l p a p e r a l p h a ) ) ; 
 
                         } ;   e l s e   { 
 
                                 g r . F i l l S o l i d R e c t ( 0 ,   0 ,   w w ,   w h ,   g _ c o l o r _ n o r m a l _ b g ) ; 
 
                         } ; 
 
 
 
                 } ; 
 
 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
         i f ( p a n e l . o p a c i t y > = 2 5 5 )   { 
 
                 g r . F i l l S o l i d R e c t ( 0 ,   0 ,   w w ,   w h ,   g _ b a c k c o l o r ) ; 
 
                 
 
         }   e l s e   i f ( p a n e l . o p a c i t y < = 1 )   { } ; 
 
         e l s e { 
 
                         g r . F i l l S o l i d R e c t ( 0 ,   0 ,   w w ,   w h ,   R G B A ( g _ b a c k c o l o r _ R ,   g _ b a c k c o l o r _ G ,   g _ b a c k c o l o r _ B ,   p a n e l . o p a c i t y ) ) ; 
 
         } ; 
 
 
 
         / /   d r a w   i t e m s 
 
         i f ( l i s t . t o t a l > 0 ) { 
 
                 g _ p l a y i n g _ i t e m _ y   =   n u l l ; 
 
                 v a r   d r a w _ l i m i t   =   l i s t . t o c u t + l i s t . n b v i s + g r o u p . n b r o w s + 1 ; 
 
                 i f ( d r a w _ l i m i t > l i s t . i t e m . l e n g t h )   d r a w _ l i m i t   =   l i s t . i t e m . l e n g t h ; 
 
                 f o r ( v a r   i d x = l i s t . t o c u t ; i d x < d r a w _ l i m i t ; i d x + + )   { 
 
                         l i s t . i t e m [ i d x ] . d r a w ( g r ,   l i s t . i t e m [ i d x ] . i d ,   i d x ) ; 
 
                 } ; 
 
         }   e l s e   { 
 
                 v s c r o l l b a r . v i s i b l e   =   f a l s e ; 
 
                 v s c r o l l b a r . w   =   0 ; 
 
 
 
                 i f ( f b . P l a y l i s t C o u n t > 0 )   { 
 
                         v a r   t e x t _ t o p   =   f b . G e t P l a y l i s t N a m e ( p l m a n . A c t i v e P l a y l i s t ) ; 
 
                         v a r   t e x t _ b o t   =   " T h i s   p l a y l i s t   i s   e m p t y " ; 
 
                 }   e l s e   { 
 
                         v a r   t e x t _ t o p   =   " B r 3 t t ' s   W S H   P l a y l i s t   V i e w e r " ; 
 
                         v a r   t e x t _ b o t   =   " C r e a t e   a   p l a y l i s t   t o   s t a r t ! " ; 
 
                 } ; 
 
                 / /   i f   e m p t y   p l a y l i s t ,   d i s p l a y   t e x t   i n f o 
 
                 g r . S e t T e x t R e n d e r i n g H i n t ( 5 ) ; 
 
                 g r . D r a w S t r i n g ( t e x t _ t o p ,   g d i . F o n t ( " t a h o m a " ,   1 7 ,   0 ) ,   g _ t e x t c o l o r & 0 x 4 0 f f f f f f ,   0 ,   t o o l b a r . h - 2 0 ,   w w ,   w h ,   c c _ s t r i n g f o r m a t ) ; 
 
                 g r . D r a w S t r i n g ( t e x t _ b o t ,   g d i . F o n t ( " t a h o m a " ,   1 3 ,   0 ) ,   g _ t e x t c o l o r & 0 x 4 0 f f f f f f ,   0 ,   t o o l b a r . h + 2 0 ,   w w ,   w h ,   c c _ s t r i n g f o r m a t ) ; 
 
                 g r . F i l l G r a d R e c t ( 4 0 ,   t o o l b a r . h + M a t h . f l o o r ( w h / 2 ) ,   w w - 8 0 ,   1 ,   0 ,   0 ,   g _ t e x t c o l o r & 0 x 4 0 f f f f f f ,   0 . 5 ) ; 
 
 
 
         } ; 
 
         
 
         / /   d r a w   t o o l b a r 
 
         i f ( ! t o o l b a r . s t a t e   & &   ! t o o l b a r . t i m e r I D 1 )   { 
 
                 / /   d r a w   m a r k e r   t o   i n d i c a t e   t o o l b a r   e x p a n d a b l e 
 
                 g r . D r a w L i n e ( M a t h . f l o o r ( ( w w - v s c r o l l b a r . w ) / 2 ) - 3 ,   2 ,   M a t h . f l o o r ( ( w w - v s c r o l l b a r . w ) / 2 ) + 3 ,   2 ,   1 . 0 ,   g _ t e x t c o l o r & 0 x 4 4 f f f f f f ) ; 
 
                 g r . D r a w L i n e ( M a t h . f l o o r ( ( w w - v s c r o l l b a r . w ) / 2 ) - 2 ,   3 ,   M a t h . f l o o r ( ( w w - v s c r o l l b a r . w ) / 2 ) + 0 ,   5 ,   1 . 0 ,   g _ t e x t c o l o r & 0 x 4 4 f f f f f f ) ; 
 
                 g r . D r a w L i n e ( M a t h . f l o o r ( ( w w - v s c r o l l b a r . w ) / 2 ) + 2 ,   3 ,   M a t h . f l o o r ( ( w w - v s c r o l l b a r . w ) / 2 ) + 1 ,   4 ,   1 . 0 ,   g _ t e x t c o l o r & 0 x 4 4 f f f f f f ) ; 
 
         } 
 
         i f ( t o o l b a r . s t a t e   | |   t o o l b a r . t i m e r I D 1 )   { 
 
                 g r . S e t S m o o t h i n g M o d e ( 2 ) ; 
 
                 / / g r . F i l l R o u n d R e c t ( 0 9 ,   ( t o o l b a r . c o l l a p s e d _ y   +   t o o l b a r . d e l t a )   -   1 0 ,   w w - v s c r o l l b a r . w - 2 0   +   2 ,   M a t h . a b s ( t o o l b a r . c o l l a p s e d _ y )   +   1 0   +   1 ,   6 ,   6 ,   R G B A ( 0 , 0 , 0 , 6 0 ) ) ; 
 
                 g r . F i l l R o u n d R e c t ( 1 0 ,   ( t o o l b a r . c o l l a p s e d _ y   +   t o o l b a r . d e l t a )   -   1 0 ,   w w - v s c r o l l b a r . w - 2 0 ,   M a t h . a b s ( t o o l b a r . c o l l a p s e d _ y )   +   1 0 ,   5 ,   5 ,   p p t . t o o l b a r _ c o l o r & R G B A ( 2 5 5 , 2 5 5 , 2 5 5 , p p t . t o o l b a r _ c o l o r _ a l p h a ) ) ; 
 
                 g r . D r a w R o u n d R e c t ( 1 1 ,   ( t o o l b a r . c o l l a p s e d _ y   +   t o o l b a r . d e l t a )   -   1 0 ,   w w - v s c r o l l b a r . w - 2 0 - 2 ,   M a t h . a b s ( t o o l b a r . c o l l a p s e d _ y )   +   1 0 - 1 ,   4 ,   4 ,   1 . 0 ,   p p t . t o o l b a r _ r e c t _ c o l o r & R G B A ( 2 5 5 , 2 5 5 , 2 5 5 , p p t . t o o l b a r _ r e c t _ c o l o r _ a l p h a ) ) ;   / / r e c t   c o l o r   R G B A ( 2 5 0 , 2 5 0 , 2 5 0 , 4 0 ) 
 
                 g r . S e t S m o o t h i n g M o d e ( 0 ) ; 
 
                 / /   d r a w   t o o l b a r   b u t t o n s 
 
                 f o r ( i = 0 ; i < t o o l b a r . b u t t o n s . l e n g t h ; i + + )   { 
 
                         s w i t c h   ( i )   { 
 
                           c a s e   0 : 
 
                                 t o o l b a r . b u t t o n s [ i ] . d r a w ( g r ,   3 0 ,   ( t o o l b a r . c o l l a p s e d _ y   +   t o o l b a r . d e l t a )   +   ( t o o l b a r . c o l l a p s e d _ y * - 1 ) / 2 - 1 3 ,   2 5 5 ) ;   / /   ( t o o l b a r . c o l l a p s e d _ y * - 1 ) / 2 - 1 0   = = =   o l d   v a l u e   + 1 3 
 
                                 b r e a k ; 
 
                           c a s e   1 : 
 
                                 t o o l b a r . b u t t o n s [ i ] . d r a w ( g r ,   w w - v s c r o l l b a r . w - 3 0 - 3 0 ,   ( t o o l b a r . c o l l a p s e d _ y   +   t o o l b a r . d e l t a )   +   ( t o o l b a r . c o l l a p s e d _ y * - 1 ) / 2 - 1 0 ,   2 5 5 ) ; 
 
                                 b r e a k ; 
 
                           c a s e   2 :   
 
                                 t o o l b a r . b u t t o n s [ i ] . d r a w ( g r ,   1 0 0 ,   ( t o o l b a r . c o l l a p s e d _ y   +   t o o l b a r . d e l t a )   +   ( t o o l b a r . c o l l a p s e d _ y * - 1 ) / 2 - 1 3 ,   2 5 5 ) ;   / /   m y   b u t t 
 
                                 b r e a k ; 
 
                           c a s e   3 : 
 
                                 t o o l b a r . b u t t o n s [ i ] . d r a w ( g r ,   1 7 0 ,   ( t o o l b a r . c o l l a p s e d _ y   +   t o o l b a r . d e l t a )   +   ( t o o l b a r . c o l l a p s e d _ y * - 1 ) / 2 - 1 3 ,   2 5 5 ) ;   / /   m y   b u t t 
 
                                 b r e a k ; 
 
                         } ; 
 
                 } ; 
 
         } ; 
 
 
 
         / /   d r a w   v s c r o l l b a r 
 
         i f ( v s c r o l l b a r . v i s i b l e   & &   v s c r o l l b a r . s h o w )   { 
 
                 / /   d r a w   s c r o l l b a r   b a c k g r o u n d 
 
                 t r y   { 
 
                         v s c r o l l b a r . t h e m e . S e t P a r t A n d S t a t e I d ( 6 ,   1 ) ; 
 
                         v s c r o l l b a r . t h e m e . D r a w T h e m e B a c k g r o u n d ( g r ,   w w - v s c r o l l b a r . w ,   0 ,   v s c r o l l b a r . w ,   w h ) ; 
 
                 }   c a t c h ( e )   { 
 
                         g r . F i l l G r a d R e c t ( w w - v s c r o l l b a r . w ,   0 ,   v s c r o l l b a r . w ,   w h ,   0 ,   R G B A ( 0 , 0 , 0 , 1 0 ) ,   R G B A ( 2 5 5 , 2 5 5 , 2 5 5 , 5 ) ,   0 . 5 ) ; 
 
                         g r . F i l l S o l i d R e c t ( w w - v s c r o l l b a r . w ,   0 ,   1 ,   w h ,   R G B A ( 0 , 0 , 0 , 2 0 ) ) ; 
 
                 } ; 
 
                 
 
                 / /   d r a w   c u r s o r 
 
                 c u r s o r . b t . d r a w ( g r ,   w w - v s c r o l l b a r . w ,   c u r s o r . y ,   2 5 5 ) ; 
 
                 
 
                 t r y   { 
 
                         v s c r o l l b a r . t h e m e . S e t P a r t A n d S t a t e I d ( 9 ,   1 ) ; 
 
                         v s c r o l l b a r . t h e m e . D r a w T h e m e B a c k g r o u n d ( g r ,   w w - v s c r o l l b a r . w ,   c u r s o r . y ,   c u r s o r . w ,   c u r s o r . h ) ; 
 
                 }   c a t c h ( e )   { } ; 
 
                 
 
                 / /   d r a w   s c r o l l b a r   b u t t o n s   ( u p / d o w n ) 
 
                 f o r ( i = 0 ; i < v s c r o l l b a r . a r r _ b u t t o n s . l e n g t h ; i + + )   { 
 
                         s w i t c h   ( i )   { 
 
                           c a s e   0 : 
 
                                 v s c r o l l b a r . a r r _ b u t t o n s [ i ] . d r a w ( g r ,   w w - v s c r o l l b a r . w ,   b u t t o n _ u p . y ,   2 5 5 ) ; 
 
                                 b r e a k ; 
 
                           c a s e   1 : 
 
                                 v s c r o l l b a r . a r r _ b u t t o n s [ i ] . d r a w ( g r ,   w w - v s c r o l l b a r . w ,   b u t t o n _ d o w n . y ,   2 5 5 ) ; 
 
                                 b r e a k ; 
 
                         } ; 
 
                 } ; 
 
                 
 
                 i f ( c u r s o r . d r a g )   { 
 
                         v s c r o l l b a r . l e t t e r   =   l i s t . i t e m [ l i s t . t o c u t ] . g r o u p _ k e y . s u b s t r i n g ( 0 , 1 ) . t o U p p e r C a s e ( ) ; 
 
                         c u r s o r . p o p u p   & &   g r . D r a w I m a g e ( c u r s o r . p o p u p ,   w w - v s c r o l l b a r . w - c u r s o r . p o p u p . W i d t h ,   c u r s o r . y + M a t h . f l o o r ( c u r s o r . h / 2 ) - M a t h . f l o o r ( c u r s o r . p o p u p . H e i g h t / 2 ) ,   c u r s o r . p o p u p . W i d t h ,   c u r s o r . p o p u p . H e i g h t ,   0 ,   0 ,   c u r s o r . p o p u p . W i d t h ,   c u r s o r . p o p u p . H e i g h t ,   0 ,   1 5 5 ) ; 
 
                         c u r s o r . p o p u p   & &   g r . G d i D r a w T e x t ( v s c r o l l b a r . l e t t e r ,   g d i . F o n t ( " s e g o e   u i " ,   1 4 ,   0 ) ,   g _ b a c k c o l o r ,   w w - v s c r o l l b a r . w - c u r s o r . p o p u p . W i d t h ,   c u r s o r . y + M a t h . f l o o r ( c u r s o r . h / 2 ) - M a t h . f l o o r ( c u r s o r . p o p u p . H e i g h t / 2 ) ,   c u r s o r . p o p u p . W i d t h - 5 ,   c u r s o r . p o p u p . H e i g h t ,   D T _ C E N T E R   |   D T _ C A L C R E C T   |   D T _ V C E N T E R   |   D T _ E N D _ E L L I P S I S   |   D T _ N O P R E F I X ) ; 
 
                 } ; 
 
         } ; 
 
         
 
         i f ( p a n e l . s h o w _ s h a d o w _ b o r d e r )   { 
 
                 / /   v e r t i c a l   l e f t   b o r d e r s   ( S u n k e n   e f f e c t ) 
 
                 g r . F i l l S o l i d R e c t ( 0 ,   t o o l b a r . h - 1 ,   1 ,   w h + 1 ,   R G B A ( 0 , 0 , 0 , 3 0 ) ) ; 
 
                 g r . F i l l S o l i d R e c t ( 1 ,   t o o l b a r . h - 1 ,   1 ,   w h + 1 ,   R G B A ( 0 , 0 , 0 , 1 5 ) ) ; 
 
                 g r . F i l l S o l i d R e c t ( 2 ,   t o o l b a r . h - 1 ,   1 ,   w h + 1 ,   R G B A ( 0 , 0 , 0 , 5 ) ) ; 
 
                 / /   a n d   t h e   r i g h t   o n e ,   o n l y   i f   s c r o l l b a r   i s   h i d d e n 
 
                 i f ( ! v s c r o l l b a r . v i s i b l e   | |   ! v s c r o l l b a r . s h o w )   { 
 
                         g r . F i l l S o l i d R e c t ( w w - v s c r o l l b a r . w - 1 ,   t o o l b a r . h - 1 ,   1 ,   w h + 1 ,   R G B A ( 0 , 0 , 0 , 3 0 ) ) ; 
 
                         g r . F i l l S o l i d R e c t ( w w - v s c r o l l b a r . w - 2 ,   t o o l b a r . h - 1 ,   1 ,   w h + 1 ,   R G B A ( 0 , 0 , 0 , 1 5 ) ) ; 
 
                         g r . F i l l S o l i d R e c t ( w w - v s c r o l l b a r . w - 3 ,   t o o l b a r . h - 1 ,   1 ,   w h + 1 ,   R G B A ( 0 , 0 , 0 , 5 ) ) ; 
 
                 }   e l s e   { 
 
                         g r . F i l l S o l i d R e c t ( w w - v s c r o l l b a r . w - 1 ,   t o o l b a r . h - 1 ,   1 ,   w h + 1 ,   R G B A ( 0 , 0 , 0 , 1 0 ) ) ; 
 
                         g r . F i l l S o l i d R e c t ( w w - v s c r o l l b a r . w - 2 ,   t o o l b a r . h - 1 ,   1 ,   w h + 1 ,   R G B A ( 0 , 0 , 0 , 5 ) ) ; 
 
                 } ; 
 
                 / /   t o p   b o r d e r 
 
                 g r . F i l l S o l i d R e c t ( 0 ,   0 ,   w w - v s c r o l l b a r . w ,   1 ,   R G B A ( 0 , 0 , 0 , 3 0 ) ) ; 
 
                 g r . F i l l S o l i d R e c t ( 1 ,   1 ,   w w - v s c r o l l b a r . w ,   1 ,   R G B A ( 0 , 0 , 0 , 1 5 ) ) ; 
 
                 g r . F i l l S o l i d R e c t ( 2 ,   2 ,   w w - v s c r o l l b a r . w ,   1 ,   R G B A ( 0 , 0 , 0 , 5 ) ) ; 
 
                 / /   b o t   b o r d e r 
 
                 g r . F i l l S o l i d R e c t ( 0 ,   w h - 1 ,   w w - v s c r o l l b a r . w ,   1 ,   R G B A ( 0 , 0 , 0 , 3 0 ) ) ; 
 
                 g r . F i l l S o l i d R e c t ( 1 ,   w h - 2 ,   w w - v s c r o l l b a r . w ,   1 ,   R G B A ( 0 , 0 , 0 , 1 5 ) ) ; 
 
                 g r . F i l l S o l i d R e c t ( 2 ,   w h - 3 ,   w w - v s c r o l l b a r . w ,   1 ,   R G B A ( 0 , 0 , 0 , 5 ) ) ; 
 
         } ; 
 
 
 
         / /   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = I n c r e m e n t a l   S e a r c h   T o o l t i p 
 
         i f ( g _ s e a r c h _ s t r i n g . l e n g t h > 0 )   { 
 
                 g r . S e t S m o o t h i n g M o d e ( 2 ) ; 
 
                 v a r   t t _ x   =   M a t h . f l o o r ( ( ( w w - v s c r o l l b a r . w )   /   2 )   -   ( ( ( g _ s e a r c h _ s t r i n g . l e n g t h * 2 3 ) + ( 1 0 * 2 ) )   /   2 ) ) ;   / / d e f   ( ( ( g _ s e a r c h _ s t r i n g . l e n g t h * 1 3 ) + ( 1 0 * 2 ) )   /   2 ) ) ; 
 
                 v a r   t t _ y   =   M a t h . f l o o r ( ( w h / 2 )   -   3 0 ) ; 
 
                 v a r   t t _ w   =   M a t h . r o u n d ( ( g _ s e a r c h _ s t r i n g . l e n g t h * 2 3 ) + ( 1 0 * 2 ) ) ; / / d e f   M a t h . r o u n d ( ( g _ s e a r c h _ s t r i n g . l e n g t h * 1 3 ) + ( 1 0 * 2 ) ) ; 
 
                 v a r   t t _ h   =   8 0 ; 
 
                 g r . F i l l R o u n d R e c t ( t t _ x ,   t t _ y ,   t t _ w ,   t t _ h ,   5 ,   5 ,   R G B A ( 0 , 0 , 0 , 1 5 0 ) ) ; 
 
                 g r . D r a w R o u n d R e c t ( t t _ x ,   t t _ y ,   t t _ w ,   t t _ h ,   5 ,   5 ,   2 . 0 ,   R G B A ( 2 5 5 , 2 5 5 , 2 5 5 , 2 0 0 ) ) ; 
 
                 g r . D r a w R o u n d R e c t ( t t _ x + 2 ,   t t _ y + 2 ,   t t _ w - 4 ,   t t _ h - 4 ,   3 ,   3 ,   1 . 0 ,   R G B A ( 0 , 0 , 0 , 1 5 0 ) ) ; 
 
                 g r . G d i D r a w T e x t ( g _ s e a r c h _ s t r i n g ,   i n c s e a r c h _ f o n t _ b i g ,   R G B ( 0 , 0 , 0 ) ,   t t _ x + 1 ,   t t _ y + 1   ,   t t _ w   ,   t t _ h ,   D T _ C E N T E R   |   D T _ N O P R E F I X   |   D T _ C A L C R E C T   |   D T _ V C E N T E R ) ; 
 
                 g r . G d i D r a w T e x t ( g _ s e a r c h _ s t r i n g ,   i n c s e a r c h _ f o n t _ b i g ,   l i s t . i n c _ s e a r c h _ n o r e s u l t ? R G B ( 2 5 5 , 7 5 , 7 5 ) : R G B ( 2 5 0 , 2 5 0 , 2 5 0 ) ,   t t _ x ,   t t _ y   ,   t t _ w   ,   t t _ h ,   D T _ C E N T E R   |   D T _ N O P R E F I X   |   D T _ C A L C R E C T   |   D T _ V C E N T E R ) ; 
 
         } ; 
 
         
 
 } ; 
 
 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = / /   M o u s e   C a l l b a c k s 
 
 v a r   l b d n   =   0 ; 
 
 v a r   y _ s t a r t   =   0 ; 
 
 v a r   y _ e n d   =   0 ; 
 
 v a r   y _ d e l t a   =   0 ; 
 
 
 
 
 
 
 
 f u n c t i o n   o n _ m o u s e _ l b t n _ d o w n ( x ,   y )   { 
 
         
 
         i f ( p p t . t o u c h _ o n ) { 
 
         l b d n   =   1 ; 
 
         y _ s t a r t   =   y ; 
 
         g _ d r a g   =   f a l s e ; 
 
         } ; 
 
         
 
         b o o l _ o n _ s i z e   =   f a l s e ; 
 
         
 
         v a r   a c t _ p l s   =   p l m a n . A c t i v e P l a y l i s t ; 
 
         
 
         / /   c h e c k   t o o l b a r   b u t t o n s 
 
         i f ( t o o l b a r . s t a t e )   { 
 
                 f o r ( v a r   j = 0 ; j < t o o l b a r . b u t t o n s . l e n g t h ; j + + )   { 
 
                         t o o l b a r . b u t t o n s [ j ] . c h e c k s t a t e ( " d o w n " ,   x ,   y ) ; 
 
                 } ; 
 
         } ; 
 
         i f ( y > t o o l b a r . d e l t a )   { 
 
                 / /   c h e c k   i t e m s 
 
                 v a r   l e n   =   l i s t . i t e m . l e n g t h ; 
 
                 r o w . b u t t o n s _ h o v e r   =   f a l s e ; 
 
                 f o r ( v a r   i = 0 ; i < l e n ; i + + )   { 
 
                         l i s t . i t e m [ i ] . c h e c k s t a t e ( " d o w n " ,   x ,   y ,   i ) ; 
 
                 } ; 
 
         } ; 
 
         
 
         / /   c h e c k   s c r o l l b a r 
 
         i f ( v s c r o l l b a r . v i s i b l e   & &   v s c r o l l b a r . s h o w )   { 
 
                 i f ( c u r s o r . b t . c h e c k s t a t e ( " d o w n " ,   x ,   y ) = = B u t t o n S t a t e s . d o w n )   { 
 
                         c u r s o r . d r a g   =   t r u e ; 
 
                         c u r s o r . g r a p _ y   =   y   -   c u r s o r . y ; 
 
                         c u r s o r . l a s t _ y   =   c u r s o r . y ; 
 
                 } ; 
 
                 i f ( v s c r o l l b a r . h o v e r   & &   ! c u r s o r . d r a g )   { 
 
                         v s c r o l l b a r . s t e p   =   l i s t . n b v i s ; 
 
                         i f ( y < c u r s o r . y )   { 
 
                                 i f ( ! l i s t . b u t t o n c l i c k e d )   { 
 
                                         l i s t . b u t t o n c l i c k e d   =   t r u e ; 
 
                                         o n _ m o u s e _ w h e e l ( v s c r o l l b a r . s t e p ) ; 
 
                                         s c r o l l b a r b t . t i m e r I D 1   =   w i n d o w . S e t T i m e o u t ( f u n c t i o n   ( )   { 
 
                                                 o n _ m o u s e _ w h e e l ( v s c r o l l b a r . s t e p ) ; 
 
                                                 s c r o l l b a r b t . t i m e r I D 1   & &   w i n d o w . C l e a r T i m e o u t ( s c r o l l b a r b t . t i m e r I D 1 ) ; 
 
                                                 s c r o l l b a r b t . t i m e r I D 1   =   f a l s e ; 
 
                                                 s c r o l l b a r b t . t i m e r I D 2   & &   w i n d o w . C l e a r I n t e r v a l ( s c r o l l b a r b t . t i m e r I D 2 ) ; 
 
                                                 s c r o l l b a r b t . t i m e r I D 2   =   w i n d o w . S e t I n t e r v a l ( f u n c t i o n   ( )   { 
 
                                                         i f ( v s c r o l l b a r . h o v e r )   { 
 
                                                                 i f ( m o u s e _ x > w w - v s c r o l l b a r . w   & &   c u r s o r . y   >   m o u s e _ y )   { 
 
                                                                         o n _ m o u s e _ w h e e l ( v s c r o l l b a r . s t e p ) ; 
 
                                                                 } ; 
 
                                                         } ; 
 
                                                 } ,   s c r o l l b a r b t . t i m e r 2 _ v a l u e + 3 0 ) ; 
 
                                         } ,   s c r o l l b a r b t . t i m e r 1 _ v a l u e ) ; 
 
                                 } ; 
 
                         }   e l s e   { 
 
                                 i f ( ! l i s t . b u t t o n c l i c k e d )   { 
 
                                         l i s t . b u t t o n c l i c k e d   =   t r u e ; 
 
                                         o n _ m o u s e _ w h e e l ( - 1 * v s c r o l l b a r . s t e p ) ; 
 
                                         s c r o l l b a r b t . t i m e r I D 1   =   w i n d o w . S e t T i m e o u t ( f u n c t i o n   ( )   { 
 
                                                 o n _ m o u s e _ w h e e l ( - 1 * v s c r o l l b a r . s t e p ) ; 
 
                                                 s c r o l l b a r b t . t i m e r I D 1   & &   w i n d o w . C l e a r T i m e o u t ( s c r o l l b a r b t . t i m e r I D 1 ) ; 
 
                                                 s c r o l l b a r b t . t i m e r I D 1   =   f a l s e ; 
 
                                                 s c r o l l b a r b t . t i m e r I D 2   & &   w i n d o w . C l e a r I n t e r v a l ( s c r o l l b a r b t . t i m e r I D 2 ) ; 
 
                                                 s c r o l l b a r b t . t i m e r I D 2   =   w i n d o w . S e t I n t e r v a l ( f u n c t i o n   ( )   { 
 
                                                         i f ( v s c r o l l b a r . h o v e r )   { 
 
                                                                 i f ( m o u s e _ x > w w - v s c r o l l b a r . w   & &   c u r s o r . y + c u r s o r . h   <   m o u s e _ y )   { 
 
                                                                         o n _ m o u s e _ w h e e l ( - 1 * v s c r o l l b a r . s t e p ) ; 
 
                                                                 } ; 
 
                                                         } ; 
 
                                                 } ,   s c r o l l b a r b t . t i m e r 2 _ v a l u e + 3 0 ) ; 
 
                                         } ,   s c r o l l b a r b t . t i m e r 1 _ v a l u e ) ; 
 
                                 } ; 
 
                         } ; 
 
                 } ; 
 
                 / /   c h e c k   o t h e r   v s c r o l l b a r   b u t t o n s 
 
                 f o r ( i = 0 ; i < v s c r o l l b a r . a r r _ b u t t o n s . l e n g t h ; i + + )   { 
 
                         s w i t c h ( i )   { 
 
                           c a s e   0 : 
 
                                 i f ( v s c r o l l b a r . a r r _ b u t t o n s [ i ] . c h e c k s t a t e ( " d o w n " ,   x ,   y ) = = B u t t o n S t a t e s . d o w n )   { 
 
                                         i f ( ! l i s t . b u t t o n c l i c k e d )   { 
 
                                                 l i s t . b u t t o n c l i c k e d   =   t r u e ; 
 
                                                 s c r o l l u p _ s p v ( a c t _ p l s ,   1 ) ; 
 
                                                 w i n d o w . R e p a i n t ( ) ; 
 
                                                 s c r o l l b a r b t . t i m e r I D 1   =   w i n d o w . S e t T i m e o u t ( f u n c t i o n   ( )   { 
 
                                                         r e s e t _ c o v e r _ t i m e r s ( ) ; 
 
                                                         s c r o l l b a r b t . t i m e r I D 1   & &   w i n d o w . C l e a r T i m e o u t ( s c r o l l b a r b t . t i m e r I D 1 ) ; 
 
                                                         s c r o l l b a r b t . t i m e r I D 1   =   f a l s e ; 
 
                                                         s c r o l l b a r b t . t i m e r I D 2   & &   w i n d o w . C l e a r I n t e r v a l ( s c r o l l b a r b t . t i m e r I D 2 ) ; 
 
                                                         s c r o l l b a r b t . t i m e r I D 2   =   w i n d o w . S e t I n t e r v a l ( f u n c t i o n   ( )   { 
 
                                                                 s c r o l l u p _ s p v ( a c t _ p l s ,   1 ) ; 
 
                                                                 w i n d o w . R e p a i n t ( ) ; 
 
                                                         } ,   s c r o l l b a r b t . t i m e r 2 _ v a l u e ) ; 
 
                                                 } ,   s c r o l l b a r b t . t i m e r 1 _ v a l u e ) ; 
 
                                         } ; 
 
                                 } ; 
 
                                 b r e a k ; 
 
                           c a s e   1 : 
 
                                 i f ( v s c r o l l b a r . a r r _ b u t t o n s [ i ] . c h e c k s t a t e ( " d o w n " ,   x ,   y ) = = B u t t o n S t a t e s . d o w n )   { 
 
                                         i f ( ! l i s t . b u t t o n c l i c k e d )   { 
 
                                                 l i s t . b u t t o n c l i c k e d   =   t r u e ; 
 
                                                 s c r o l l d o w n _ s p v ( a c t _ p l s ,   1 ) ; 
 
                                                 w i n d o w . R e p a i n t ( ) ; 
 
                                                 s c r o l l b a r b t . t i m e r I D 1   =   w i n d o w . S e t T i m e o u t ( f u n c t i o n   ( )   { 
 
                                                         r e s e t _ c o v e r _ t i m e r s ( ) ; 
 
                                                         s c r o l l b a r b t . t i m e r I D 1   & &   w i n d o w . C l e a r T i m e o u t ( s c r o l l b a r b t . t i m e r I D 1 ) ; 
 
                                                         s c r o l l b a r b t . t i m e r I D 1   =   f a l s e ; 
 
                                                         s c r o l l b a r b t . t i m e r I D 2   & &   w i n d o w . C l e a r I n t e r v a l ( s c r o l l b a r b t . t i m e r I D 2 ) ; 
 
                                                         s c r o l l b a r b t . t i m e r I D 2   =   w i n d o w . S e t I n t e r v a l ( f u n c t i o n   ( )   { 
 
                                                                 s c r o l l d o w n _ s p v ( a c t _ p l s ,   1 ) ; 
 
                                                                 w i n d o w . R e p a i n t ( ) ; 
 
                                                         } ,   s c r o l l b a r b t . t i m e r 2 _ v a l u e ) ; 
 
                                                 } ,   s c r o l l b a r b t . t i m e r 1 _ v a l u e ) ; 
 
                                         } ; 
 
                                 } ; 
 
                                 b r e a k ; 
 
                         } ; 
 
                 } ; 
 
         } ; 
 
 } ; 
 
 
 
 f u n c t i o n   o n _ m o u s e _ l b t n _ d b l c l k ( x ,   y ,   m a s k )   { 
 
 
 
         i f ( y < t o o l b a r . d e l t a )   { 
 
                 S h o w N o w P l a y i n g ( ) ; 
 
         }   e l s e   i f ( x < w w - v s c r o l l b a r . w )   { 
 
                 v a r   l e n   =   l i s t . i t e m . l e n g t h ; 
 
                 r o w . b u t t o n s _ h o v e r   =   f a l s e ; 
 
                 f o r ( v a r   i = 0 ; i < l e n ; i + + )   { 
 
                         l i s t . i t e m [ i ] . c h e c k s t a t e ( " d b l c l k " ,   x ,   y ,   i ) ; 
 
                 } ; 
 
         }   e l s e   { 
 
                 o n _ m o u s e _ l b t n _ d o w n ( x ,   y ) ; 
 
         } ; 
 
 } ; 
 
 
 
 f u n c t i o n   o n _ m o u s e _ l b t n _ u p ( x ,   y )   { 
 
         l b d n   =   0 ; 
 
         y _ s t a r t   =   y ; 
 
         v s c r o l l b a r . s t e p   =   v s c r o l l b a r . d e f a u l t _ s t e p ; 
 
 
 
         / /   s c r o l l b a r   b u t t o n   u p   a n d   d o w n   R E S E T 
 
         l i s t . b u t t o n c l i c k e d   =   f a l s e ; 
 
         s c r o l l b a r b t . t i m e r I D 1   & &   w i n d o w . C l e a r T i m e o u t ( s c r o l l b a r b t . t i m e r I D 1 ) ; 
 
         s c r o l l b a r b t . t i m e r I D 1   =   f a l s e ; 
 
         s c r o l l b a r b t . t i m e r I D 2   & &   w i n d o w . C l e a r T i m e o u t ( s c r o l l b a r b t . t i m e r I D 2 ) ; 
 
         s c r o l l b a r b t . t i m e r I D 2   =   f a l s e ; 
 
 
 
         / /   c h e c k   t o o l b a r   b u t t o n s 
 
         i f ( t o o l b a r . s t a t e )   { 
 
                 f o r ( v a r   j = 0 ; j < t o o l b a r . b u t t o n s . l e n g t h ; j + + )   { 
 
                         s w i t c h ( j )   { 
 
                                 c a s e   0 : 
 
                                         i f ( t o o l b a r . b u t t o n s [ j ] . c h e c k s t a t e ( " u p " ,   x ,   y ) = = B u t t o n S t a t e s . h o v e r )   { 
 
                                                 g _ m e n u _ d i s p l a y e d   =   t r u e ; 
 
                                                 s e t t i n g s _ m e n u ( x ,   y ) ; 
 
                                         } ; 
 
                                         b r e a k ; 
 
                                 c a s e   1 : 
 
                                         i f ( t o o l b a r . b u t t o n s [ j ] . c h e c k s t a t e ( " u p " ,   x ,   y ) = = B u t t o n S t a t e s . h o v e r )   { 
 
                                                 g _ m e n u _ d i s p l a y e d   =   t r u e ; 
 
                                                 s o r t _ g r o u p _ m e n u ( x ,   y ) ; 
 
                                         } ; 
 
                                         b r e a k ; 
 
                                 c a s e   2 : 
 
                                         i f ( t o o l b a r . b u t t o n s [ j ] . c h e c k s t a t e ( " u p " ,   x ,   y ) = = B u t t o n S t a t e s . h o v e r )   { 
 
                                                 p p t . w a l l p a p e r b l u r r e d   =   ! p p t . w a l l p a p e r b l u r r e d ; 
 
                                                 w i n d o w . S e t P r o p e r t y ( " _ D I S P L A Y :   W a l l p a p e r   B l u r r e d " ,   p p t . w a l l p a p e r b l u r r e d ) ; 
 
                                                 o n _ s i z e ( ) ; 
 
                                         } ; 
 
                                         b r e a k ; 
 
                                 c a s e   3 : 
 
                                         i f ( t o o l b a r . b u t t o n s [ j ] . c h e c k s t a t e ( " u p " ,   x ,   y ) = = B u t t o n S t a t e s . h o v e r )   { 
 
                                                 p p t . s h o w w a l l p a p e r   =   ! p p t . s h o w w a l l p a p e r ; 
 
                                                 w i n d o w . S e t P r o p e r t y ( " _ D I S P L A Y :   S h o w   W a l l p a p e r " ,   p p t . s h o w w a l l p a p e r ) ; 
 
                                                 o n _ s i z e ( ) ; 
 
                                         } ; 
 
                                         b r e a k ; 
 
                         } ; 
 
                 } ; 
 
         } ; 
 
 
 
         i f ( l i s t . t o t a l > 0 )   { 
 
             
 
                 / /   c h e c k   s c r o l l b a r   b u t t o n s 
 
                 c u r s o r . b t . c h e c k s t a t e ( " u p " ,   x ,   y ) ; 
 
                 f o r ( i = 0 ; i < v s c r o l l b a r . a r r _ b u t t o n s . l e n g t h ; i + + )   { 
 
                         v s c r o l l b a r . a r r _ b u t t o n s [ i ] . c h e c k s t a t e ( " u p " ,   x ,   y ) ; 
 
                 } ; 
 
                 
 
                 i f ( c u r s o r . d r a g )   { 
 
                         w i n d o w . R e p a i n t R e c t ( w w - v s c r o l l b a r . w - c u r s o r . p o p u p . W i d t h - 5 ,   0 ,   c u r s o r . p o p u p . W i d t h + v s c r o l l b a r . w + 5 ,   w h ) ; 
 
                         c u r s o r . d r a g   =   f a l s e ; 
 
                         / / s e t c u r s o r y ( ) ; 
 
                 }   e l s e   { 
 
                         / /   c h e c k   i t e m s 
 
                         v a r   l e n   =   l i s t . i t e m . l e n g t h ; 
 
                         r o w . b u t t o n s _ h o v e r   =   f a l s e ; 
 
                         f o r ( i = 0 ; i < l e n ; i + + )   { 
 
                                 l i s t . i t e m [ i ] . c h e c k s t a t e ( " u p " ,   x ,   y ,   i ) ; 
 
                         } ; 
 
                 } ; 
 
                 w i n d o w . R e p a i n t ( ) ; 
 
         } ; 
 
 
 
 
 
         / /   D r o p   i t e m s   a f t e r   a   d r a g ' n   d r o p   o u t s i d e   t h e   p l a y l i s t   ( e . g .   t o   a   W S H   p l a y l i s t   t a b   m a n a g e r   p a n e l ) 
 
         i f ( d r a g n d r o p . d r a g _ o u t )   { 
 
                 i f ( ! p a n e l . i s h o v e r )   { 
 
                         w i n d o w . N o t i f y O t h e r s ( " W S H _ p l a y l i s t _ d r a g _ d r o p " ,   l i s t . m e t a d b l i s t _ s e l e c t i o n ) ; 
 
                         d r a g n d r o p . d r a g _ o u t   =   f a l s e ; 
 
                 } ; 
 
         } ; 
 
         / /   D r o p   i t e m s   a f t e r   a   d r a g ' n   d r o p   i n s i d e   t h e   p a n e l   p l a y l i s t 
 
         i f ( d r a g n d r o p . d r a g _ i n )   { 
 
                 i f ( p a n e l . i s h o v e r   & &   d r a g n d r o p . d r a g _ i d > = 0   & &   d r a g n d r o p . d r o p _ i d > = 0 ) { 
 
                         v a r   n b _ s e l e c t e d _ i t e m s   =   l i s t . m e t a d b l i s t _ s e l e c t i o n . C o u n t ; 
 
                         i f ( d r a g n d r o p . d r o p _ i d   >   d r a g n d r o p . d r a g _ i d )   { 
 
                                 / /   o n   p o i n t e   s u r   l e   d e r n i e r   i t e m   d e   l a   s e l e c t i o n   s i   o n   m o v e   v e r s   l e   b a s 
 
                                 v a r   n e w _ d r a g _ p o s   =   l i s t . h a n d l e l i s t . F i n d ( l i s t . m e t a d b l i s t _ s e l e c t i o n . i t e m ( n b _ s e l e c t e d _ i t e m s - 1 ) ) ; 
 
                         }   e l s e   { 
 
                                 / /   o n   p o i n t e   s u r   l e   1 e r   i t e m   d e   l a   s e l e c t i o n   s i   o n   m o v e   v e r s   l e   h a u t 
 
                                 v a r   n e w _ d r a g _ p o s   =   l i s t . h a n d l e l i s t . F i n d ( l i s t . m e t a d b l i s t _ s e l e c t i o n . i t e m ( 0 ) ) ; 
 
                         } ; 
 
                         v a r   m o v e _ d e l t a   =   d r a g n d r o p . d r o p _ i d   -   n e w _ d r a g _ p o s ; 
 
                         p l m a n . M o v e P l a y l i s t S e l e c t i o n ( p l m a n . A c t i v e P l a y l i s t ,   m o v e _ d e l t a ) ; 
 
                 } ; 
 
         } ; 
 
         d r a g n d r o p . d r a g _ i d   =   - 1 ; 
 
         d r a g n d r o p . d r o p _ i d   =   - 1 ; 
 
         d r a g n d r o p . d r a g _ i n   =   f a l s e ; 
 
         d r a g n d r o p . d r a g _ o u t   =   f a l s e ; 
 
         d r a g n d r o p . t i m e r I D   & &   w i n d o w . C l e a r T i m e o u t ( d r a g n d r o p . t i m e r I D ) ; 
 
         d r a g n d r o p . t i m e r I D   =   f a l s e ; 
 
         w i n d o w . S e t C u r s o r ( I D C _ A R R O W ) ; 
 
         
 
         g _ d r a g   =   f a l s e ; 
 
         
 
         / /   t o o l b a r   c o l l a p s e   i f   m o u s e   o u t   a f t e r   a   l b t n   u p 
 
         i f ( ! t o o l b a r . l o c k )   { 
 
                 i f ( y > 3 0   | |   x < 1 0   | |   x > w w - v s c r o l l b a r . w - 1 0 )   { 
 
                         i f ( t o o l b a r . d e l t a = = 0 )   { 
 
                                 t o o l b a r . t i m e r I D _ o n   & &   w i n d o w . C l e a r T i m e o u t ( t o o l b a r . t i m e r I D _ o n ) ; 
 
                                 t o o l b a r . t i m e r I D _ o n   =   f a l s e ; 
 
                         } ; 
 
                         i f ( t o o l b a r . s t a t e )   { 
 
                                 i f ( ! t o o l b a r . t i m e r I D _ o f f )   { 
 
                                         i f ( t o o l b a r . d e l t a   = =   t o o l b a r . c o l l a p s e d _ y * - 1 )   { 
 
                                                 t o o l b a r . t i m e r I D _ o f f   =   w i n d o w . S e t T i m e o u t ( f u n c t i o n ( )   { 
 
                                                         i f ( ! t o o l b a r . t i m e r I D 2 )   { 
 
                                                                 t o o l b a r . t i m e r I D 2   =   w i n d o w . S e t I n t e r v a l ( f u n c t i o n ( )   { 
 
                                                                         t o o l b a r . d e l t a   - =   t o o l b a r . s t e p ; 
 
                                                                         i f ( t o o l b a r . d e l t a   < =   0 )   { 
 
                                                                                 t o o l b a r . d e l t a   =   0 ; 
 
                                                                                 t o o l b a r . s t a t e   =   f a l s e ; 
 
                                                                                 w i n d o w . C l e a r I n t e r v a l ( t o o l b a r . t i m e r I D 2 ) ; 
 
                                                                                 t o o l b a r . t i m e r I D 2   =   f a l s e ; 
 
                                                                         } ; 
 
                                                                         w i n d o w . R e p a i n t R e c t ( 0 ,   0 ,   w w ,   t o o l b a r . c o l l a p s e d _ y * - 1 + 5 ) ; / / 3 0 
 
                                                                 } ,   3 0 ) ; 
 
                                                         }   ; 
 
                                                         t o o l b a r . t i m e r I D _ o f f   & &   w i n d o w . C l e a r T i m e o u t ( t o o l b a r . t i m e r I D _ o f f ) ; 
 
                                                         t o o l b a r . t i m e r I D _ o f f   =   f a l s e ; 
 
                                                 } ,   4 0 0 ) ; 
 
                                         } ; 
 
                                 } ;       
 
                         } ; 
 
                 } ; 
 
         } ; 
 
 } ; 
 
 
 
 f u n c t i o n   o n _ m o u s e _ r b t n _ d o w n ( x ,   y )   { 
 
         
 
         b o o l _ o n _ s i z e   =   f a l s e ; 
 
         
 
         v a r   l e n   =   l i s t . i t e m . l e n g t h ; 
 
         r o w . b u t t o n s _ h o v e r   =   f a l s e ; 
 
         f o r ( v a r   i = 0 ; i < l e n ; i + + )   { 
 
                 i f ( l i s t . i t e m [ i ] . c h e c k s t a t e ( " r i g h t " ,   x ,   y ,   i ) = = - 1 )   b r e a k ; 
 
         } ; 
 
 } ; 
 
 
 
 f u n c t i o n   o n _ m o u s e _ r b t n _ u p ( x ,   y )   { 
 
         i f ( ! u t i l s . I s K e y P r e s s e d ( V K _ S H I F T ) )   { 
 
                 r e t u r n   t r u e ; 
 
         } ; 
 
 } ; 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = T o u c h   s c r o l l 
 
 f u n c t i o n   o n _ m o u s e _ m o v e ( x ,   y )   { 
 
         i f   ( l b d n   & &   p p t . t o u c h _ o n )   { 
 
                       y _ e n d   =   y ; 
 
                       y _ d e l t a   =   ( y _ e n d   -   y _ s t a r t ) ;         
 
             i f   ( x   <   w w - p p t . s c r o l l _ z o n e _ c o n t r o l ) { 
 
                       r e s e t _ c o v e r _ t i m e r s ( ) ; 
 
 	 v a r   a c t _ p l s   =   p l m a n . A c t i v e P l a y l i s t ; 
 
             i f   ( y _ d e l t a   >   w h / p p t . t o u c h _ s e n s )   { 
 
                   o n _ m o u s e _ w h e e l ( 1 ) ; 
 
                   y _ s t a r t   =   y _ e n d ;     
 
         }   
 
             i f   ( y _ d e l t a   <   - w h / p p t . t o u c h _ s e n s )   { 
 
 	           o n _ m o u s e _ w h e e l ( - 1 ) ; 
 
                   y _ s t a r t   =   y _ e n d ;       
 
 	 } ; 
 
 } 
 
         i f   ( x   > =   w w - p p t . s c r o l l _ z o n e _ c o n t r o l ) { 
 
         i f   ( y _ d e l t a   >   0 )   { 
 
                 f o r   ( i   =   0 ;   i   <   y _ d e l t a / p p t . s c r o l l _ z o n e _ s e n s i t i v i t y ;   i + + )   { 
 
 	 	 	 o n _ m o u s e _ w h e e l ( 1 ) ; 
 
 	 	 } ; 
 
               y _ s t a r t   =   y _ e n d ;     
 
 	 }   
 
         e l s e   { 
 
         i f   ( y _ d e l t a   <   0 )   { 
 
               f o r   ( i   =   0 ;   i   <   - y _ d e l t a / p p t . s c r o l l _ z o n e _ s e n s i t i v i t y ;   i + + )   { 
 
 	 	 	 o n _ m o u s e _ w h e e l ( - 1 ) ; 
 
 	 	 } ; 
 
             y _ s t a r t   =   y _ e n d ;       
 
 	     } ; 
 
         } 
 
     } 
 
 } 
 
         v a r   t x t   =   " " ; 
 
         s h o w _ t o o l t i p   =   f a l s e ; 
 
         
 
         i f ( x = = m o u s e _ x   & &   y = = m o u s e _ y )   r e t u r n   t r u e ; 
 
         
 
         v a r   a c t _ p l s   =   p l m a n . A c t i v e P l a y l i s t ; 
 
         
 
         p a n e l . i s h o v e r   =   ( x > = 0   & &   x < = w w   & &   y > = 0   & &   y < = w h ) ; 
 
         / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 
 
         i f ( ! p p t . t o u c h _ o n   & &   d r a g n d r o p . e n a b l e d   & &   ( d r a g n d r o p . d r a g _ i n   | |   d r a g n d r o p . d r a g _ o u t ) )   w i n d o w . S e t C u r s o r ( I D C _ H E L P ) ;   e l s e   w i n d o w . S e t C u r s o r ( I D C _ A R R O W ) ; 
 
         / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 
 
         i f ( y > t o o l b a r . d e l t a )   { 
 
                 v a r   l e n   =   l i s t . i t e m . l e n g t h ; 
 
                 v a r   m o v e _ l i m i t   =   l i s t . t o c u t + l i s t . n b v i s + g r o u p . n b r o w s + 1 ; 
 
                 i f ( m o v e _ l i m i t > l e n )   m o v e _ l i m i t   =   l e n ; 
 
                 r o w . b u t t o n s _ h o v e r   =   f a l s e ; 
 
                 f o r ( v a r   j = l i s t . t o c u t ; j < m o v e _ l i m i t ; j + + )   { 
 
                         l i s t . i t e m [ j ] . c h e c k s t a t e ( " m o v e " ,   x ,   y ,   j ) ; 
 
                         i f ( l i s t . i t e m [ j ] . i s h o v e r   & &   x > c o l u m n s . t i t l e _ x   & &   x < c o l u m n s . t i t l e _ x + c o l u m n s . t i t l e _ w )   { 
 
                                 i f ( g r o u p . n b r o w s = = 0   | |   ( c o l u m n s . t i t l e = = 1   & &   l i s t . i t e m [ j ] . a r t i s t ! = l i s t . i t e m [ j ] . a l b u m a r t i s t )   | |   c o l u m n s . t i t l e = = 2 )   { 
 
                                         t x t   =   l i s t . i t e m [ j ] . t i t l e + "   " + p a n e l . t a g _ s e p a r a t o r + "   " + l i s t . i t e m [ j ] . a r t i s t ; 
 
                                 }   e l s e   { 
 
                                         t x t   =   l i s t . i t e m [ j ] . t i t l e ; 
 
                                 } ; 
 
                                 i f ( t x t )   { 
 
                                         i f ( t x t . l e n g t h > 0   & &   l i s t . i t e m [ j ] . t o o l t i p   & &   ! g _ t o o l t i p _ t i m e r )   { 
 
                                                 s h o w _ t o o l t i p   =   t r u e ; 
 
                                         } 
 
                                 } ; 
 
                                 i f ( g _ t o o l t i p . T e x t   ! =   t x t )   {           
 
                                         g _ t o o l t i p . D e a c t i v a t e ( ) ; 
 
                                         g _ t o o l t i p . T r a c k A c t i v a t e   =   t r u e ; 
 
                                         g _ t o o l t i p . T e x t   =   t x t   ?   t x t   :   " " ; 
 
                                         g _ t o o l t i p . T r a c k P o s i t i o n ( c o l u m n s . t i t l e _ x - 6 ,   l i s t . i t e m [ j ] . y + M a t h . f l o o r ( r o w . h / 2 ) - ( 1 8 / 2 ) ) ; 
 
                                 } ; 
 
                         } ; 
 
                 } ; 
 
         }   e l s e   { 
 
                 / /   c h e c k   t o o l b a r   b u t t o n s 
 
                 i f ( t o o l b a r . s t a t e )   { 
 
                         f o r ( j = 0 ; j < t o o l b a r . b u t t o n s . l e n g t h ; j + + )   { 
 
                                 t o o l b a r . b u t t o n s [ j ] . c h e c k s t a t e ( " m o v e " ,   x ,   y ) ; 
 
                         } ; 
 
                 } ; 
 
         } ; 
 
 
 
         i f ( s h o w _ t o o l t i p )   { 
 
                 g _ t o o l t i p . A c t i v a t e ( ) ; 
 
                 g _ t o o l t i p . T r a c k A c t i v a t e   =   t r u e ; 
 
         }   e l s e   { 
 
                 g _ t o o l t i p . D e a c t i v a t e ( ) ; 
 
                 g _ t o o l t i p . T r a c k A c t i v a t e   =   f a l s e ; 
 
                 g _ t o o l t i p . T e x t = " " ; 
 
         } 
 
         
 
         i f ( l i s t . i t e m . l e n g t h > 0   & &   v s c r o l l b a r . v i s i b l e   & &   v s c r o l l b a r . s h o w )   { 
 
                 v s c r o l l b a r . h o v e r   =   ( x > = w w - v s c r o l l b a r . w   & &   x < = w w   & &   y > = v s c r o l l b a r . y   & &   y < = v s c r o l l b a r . y + v s c r o l l b a r . h ) ; 
 
                 c u r s o r . h o v e r   =   ( x > = c u r s o r . x   & &   x < = c u r s o r . x + c u r s o r . w   & &   y > = c u r s o r . y   & &   y < = c u r s o r . y + c u r s o r . h ) ; 
 
                 / /   c h e c k   b u t t o n s 
 
                 c u r s o r . b t . c h e c k s t a t e ( " m o v e " ,   x ,   y ) ; 
 
                               
 
                 f o r ( v a r   i = 0 ; i < v s c r o l l b a r . a r r _ b u t t o n s . l e n g t h ; i + + )   { 
 
                         v s c r o l l b a r . a r r _ b u t t o n s [ i ] . c h e c k s t a t e ( " m o v e " ,   x ,   y ) ; 
 
                 } ; 
 
                 i f ( c u r s o r . d r a g   & &   m o u s e _ y ! = y )   { 
 
                         r e s e t _ c o v e r _ t i m e r s ( ) ; 
 
                         c u r s o r . y   =   y   -   c u r s o r . g r a p _ y ; 
 
                         / /   c h e c k   b o u n d a r i e s 
 
                         i f ( c u r s o r . y < v s c r o l l b a r . y )   c u r s o r . y   =   v s c r o l l b a r . y ; 
 
                         i f ( c u r s o r . y > v s c r o l l b a r . y + v s c r o l l b a r . h - c u r s o r . h )   c u r s o r . y   =   v s c r o l l b a r . y + v s c r o l l b a r . h - c u r s o r . h ; 
 
                         i f ( ! c u r s o r . t i m e r I D )   { 
 
                                 c u r s o r . t i m e r I D   =   w i n d o w . S e t T i m e o u t ( f u n c t i o n ( )   { 
 
                                         r e f r e s h _ s p v _ c u r s o r ( a c t _ p l s ) ; 
 
                                         w i n d o w . R e p a i n t ( ) ; 
 
                                         c u r s o r . t i m e r I D   & &   w i n d o w . C l e a r T i m e o u t ( c u r s o r . t i m e r I D ) ; 
 
                                         c u r s o r . t i m e r I D   =   f a l s e ; 
 
                                 } ,   3 0 ) ; 
 
                         } ; 
 
                 } ; 
 
         } ; 
 
         
 
         s h o w _ t o o l t i p   =   f a l s e ; 
 
         / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 
 
         i f ( ! p p t . t o u c h _ o n   & &   d r a g n d r o p . d r a g _ i n )   { 
 
                 i f ( y < t o o l b a r . h   & &   y   >   t o o l b a r . h - r o w . h )   { 
 
                         i f ( ! l i s t . b u t t o n c l i c k e d )   { 
 
                                 l i s t . b u t t o n c l i c k e d   =   t r u e ; 
 
                                 s c r o l l b a r b t . t i m e r I D 1   =   w i n d o w . S e t I n t e r v a l ( f u n c t i o n   ( )   { 
 
                                         r e s e t _ c o v e r _ t i m e r s ( ) ; 
 
                                         f o r ( i = 0 ; i < l i s t . m o u s e w h e e l _ s c r o l l s t e p ; i + + )   { 
 
                                                 s c r o l l u p _ s p v ( a c t _ p l s ,   1 ) ; 
 
                                         } ; 
 
                                         w i n d o w . R e p a i n t ( ) ; 
 
                                 } ,   1 0 0 ) ; 
 
                         } ; 
 
                 }   e l s e   i f ( y > w h   & &   y   <   w h + r o w . h )   { 
 
                         i f ( ! l i s t . b u t t o n c l i c k e d )   { 
 
                                 l i s t . b u t t o n c l i c k e d   =   t r u e ; 
 
                                 s c r o l l b a r b t . t i m e r I D 1   =   w i n d o w . S e t I n t e r v a l ( f u n c t i o n   ( )   { 
 
                                         r e s e t _ c o v e r _ t i m e r s ( ) ; 
 
                                         f o r ( i = 0 ; i < l i s t . m o u s e w h e e l _ s c r o l l s t e p ; i + + )   { 
 
                                                 s c r o l l d o w n _ s p v ( a c t _ p l s ,   1 ) ; 
 
                                         } ; 
 
                                         w i n d o w . R e p a i n t ( ) ; 
 
                                 } ,   1 0 0 ) ; 
 
                         } ; 
 
                 }   e l s e   { 
 
                         s c r o l l b a r b t . t i m e r I D 1   & &   w i n d o w . C l e a r I n t e r v a l ( s c r o l l b a r b t . t i m e r I D 1 ) ; 
 
                         s c r o l l b a r b t . t i m e r I D 1   =   f a l s e ; 
 
                         l i s t . b u t t o n c l i c k e d   =   f a l s e ; 
 
                         i f ( M a t h . f l o o r ( ( y - t o o l b a r . h ) / r o w . h ) ! = M a t h . f l o o r ( ( m o u s e _ y - t o o l b a r . h ) / r o w . h ) )   { 
 
                                 i f ( ! d r a g n d r o p . t i m e r I D )   { 
 
                                         d r a g n d r o p . t i m e r I D   =   w i n d o w . S e t T i m e o u t ( f u n c t i o n ( )   { 
 
                                                 w i n d o w . R e p a i n t ( ) ; 
 
                                                 d r a g n d r o p . t i m e r I D   & &   w i n d o w . C l e a r T i m e o u t ( d r a g n d r o p . t i m e r I D ) ; 
 
                                                 d r a g n d r o p . t i m e r I D   =   f a l s e ; 
 
                                         } ,   3 0 ) ; 
 
                                 } ; 
 
                         } ; 
 
                 } ; 
 
         } ; 
 
         / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 
 
         / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =   h i d e / s h o w   t o o l b a r 
 
         i f ( ! t o o l b a r . l o c k   & &   ! g _ d r a g )   { 
 
                 i f ( y > = 0   & &   y < = t o o l b a r . c o l l a p s e d _ y * - 1   & &   x > 1 0   & &   x < w w - v s c r o l l b a r . w - 1 0 )   { 
 
                         i f ( ! r o w . b u t t o n s _ h o v e r   & &   ! d r a g n d r o p . d r a g _ i n   & &   ! d r a g n d r o p . d r a g _ o u t )   { 
 
                                 i f ( t o o l b a r . d e l t a = = t o o l b a r . c o l l a p s e d _ y * - 1 )   { 
 
                                         t o o l b a r . t i m e r I D _ o f f   & &   w i n d o w . C l e a r T i m e o u t ( t o o l b a r . t i m e r I D _ o f f ) ; 
 
                                         t o o l b a r . t i m e r I D _ o f f   =   f a l s e ; 
 
                                 } ; 
 
                                 i f ( ! t o o l b a r . t i m e r I D _ o n )   { 
 
                                         i f ( t o o l b a r . d e l t a = = 0 )   { 
 
                                                 t o o l b a r . t i m e r I D _ o n   =   w i n d o w . S e t T i m e o u t ( f u n c t i o n ( )   { 
 
                                                         t o o l b a r . t i m e r I D 2   & &   w i n d o w . C l e a r I n t e r v a l ( t o o l b a r . t i m e r I D 2 ) ; 
 
                                                         t o o l b a r . t i m e r I D 2   =   f a l s e ; 
 
                                                         i f ( ! t o o l b a r . t i m e r I D 1 )   { 
 
                                                                 t o o l b a r . t i m e r I D 1   =   w i n d o w . S e t I n t e r v a l ( f u n c t i o n ( )   { 
 
                                                                         t o o l b a r . d e l t a   + =   t o o l b a r . s t e p ; 
 
                                                                         i f ( t o o l b a r . c o l l a p s e d _ y   +   t o o l b a r . d e l t a   > =   0 )   { 
 
                                                                                 t o o l b a r . d e l t a   =   t o o l b a r . c o l l a p s e d _ y * - 1 ; 
 
                                                                                 t o o l b a r . s t a t e   =   t r u e ; 
 
                                                                                 w i n d o w . C l e a r I n t e r v a l ( t o o l b a r . t i m e r I D 1 ) ; 
 
                                                                                 t o o l b a r . t i m e r I D 1   =   f a l s e ; 
 
                                                                         } ; 
 
                                                                         w i n d o w . R e p a i n t R e c t ( 0 ,   0 ,   w w ,   t o o l b a r . c o l l a p s e d _ y * - 1 + 5 ) ;   / / w h - - - 3 0 
 
                                                                 } ,   3 0 ) ; 
 
                                                         } ; 
 
                                                         t o o l b a r . t i m e r I D _ o n   & &   w i n d o w . C l e a r T i m e o u t ( t o o l b a r . t i m e r I D _ o n ) ; 
 
                                                         t o o l b a r . t i m e r I D _ o n   =   f a l s e ; 
 
                                                 } ,   4 0 0 ) ; 
 
                                         }   e l s e   i f ( t o o l b a r . t i m e r I D 2 )   { 
 
                                                 t o o l b a r . t i m e r I D 2   & &   w i n d o w . C l e a r I n t e r v a l ( t o o l b a r . t i m e r I D 2 ) ; 
 
                                                 t o o l b a r . t i m e r I D 2   =   f a l s e ; 
 
                                                 i f ( ! t o o l b a r . t i m e r I D 1 )   { 
 
                                                         t o o l b a r . t i m e r I D 1   =   w i n d o w . S e t I n t e r v a l ( f u n c t i o n ( )   { 
 
                                                                 t o o l b a r . d e l t a   + =   t o o l b a r . s t e p ; 
 
                                                                 i f ( t o o l b a r . c o l l a p s e d _ y   +   t o o l b a r . d e l t a   > =   0 )   { 
 
                                                                         t o o l b a r . d e l t a   =   t o o l b a r . c o l l a p s e d _ y * - 1 ; 
 
                                                                         t o o l b a r . s t a t e   =   t r u e ; 
 
                                                                         w i n d o w . C l e a r I n t e r v a l ( t o o l b a r . t i m e r I D 1 ) ; 
 
                                                                         t o o l b a r . t i m e r I D 1   =   f a l s e ; 
 
                                                                 } ; 
 
                                                                 w i n d o w . R e p a i n t R e c t ( 0 ,   0 ,   w w ,   t o o l b a r . c o l l a p s e d _ y * - 1 + 5 ) ;   / / w h - - 3 0 
 
                                                         } ,   3 0 ) ; 
 
                                                 } ; 
 
                                         } ; 
 
                                 } ; 
 
                         } ; 
 
                 }   e l s e   i f ( y > 3 0   | |   x < 1 0   | |   x > w w - v s c r o l l b a r . w - 1 0 )   { 
 
                         i f ( t o o l b a r . d e l t a = = 0 )   { 
 
                                 t o o l b a r . t i m e r I D _ o n   & &   w i n d o w . C l e a r T i m e o u t ( t o o l b a r . t i m e r I D _ o n ) ; 
 
                                 t o o l b a r . t i m e r I D _ o n   =   f a l s e ; 
 
                         } ; 
 
                         i f ( t o o l b a r . s t a t e )   { 
 
                                 i f ( ! t o o l b a r . t i m e r I D _ o f f )   { 
 
                                         i f ( t o o l b a r . d e l t a   = =   t o o l b a r . c o l l a p s e d _ y * - 1 )   { 
 
                                                 t o o l b a r . t i m e r I D _ o f f   =   w i n d o w . S e t T i m e o u t ( f u n c t i o n ( )   { 
 
                                                         i f ( ! t o o l b a r . t i m e r I D 2 )   { 
 
                                                                 t o o l b a r . t i m e r I D 2   =   w i n d o w . S e t I n t e r v a l ( f u n c t i o n ( )   { 
 
                                                                         t o o l b a r . d e l t a   - =   t o o l b a r . s t e p ; 
 
                                                                         i f ( t o o l b a r . d e l t a   < =   0 )   { 
 
                                                                                 t o o l b a r . d e l t a   =   0 ; 
 
                                                                                 t o o l b a r . s t a t e   =   f a l s e ; 
 
                                                                                 w i n d o w . C l e a r I n t e r v a l ( t o o l b a r . t i m e r I D 2 ) ; 
 
                                                                                 t o o l b a r . t i m e r I D 2   =   f a l s e ; 
 
                                                                         } ; 
 
                                                                         w i n d o w . R e p a i n t R e c t ( 0 ,   0 ,   w w ,   t o o l b a r . c o l l a p s e d _ y * - 1 + 5 ) ; 
 
                                                                 } ,   3 0 ) ; 
 
                                                         }   ; 
 
                                                         t o o l b a r . t i m e r I D _ o f f   & &   w i n d o w . C l e a r T i m e o u t ( t o o l b a r . t i m e r I D _ o f f ) ; 
 
                                                         t o o l b a r . t i m e r I D _ o f f   =   f a l s e ; 
 
                                                 } ,   4 0 0 ) ; 
 
                                         } ; 
 
                                 } ;       
 
                         } ; 
 
                 } ; 
 
         } ; 
 
       
 
         m o u s e _ x   =   x ; 
 
         m o u s e _ y   =   y ; 
 
 } ; 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = W h e e l   s t e p 
 
 f u n c t i o n   o n _ m o u s e _ w h e e l ( d e l t a )   { 
 
         
 
         g _ t o o l t i p . T e x t = " " ; 
 
           
 
         r e s e t _ c o v e r _ t i m e r s ( ) ; 
 
         v a r   a c t _ p l s   =   p l m a n . A c t i v e P l a y l i s t ; 
 
         v a r   a b s _ d e l t a   =   M a t h . a b s ( d e l t a ) ; 
 
         i f ( a b s _ d e l t a = = 1 )   { 
 
                 i f ( d e l t a > 0 )   { 
 
                         f o r ( v a r   i = 0 ; i < l i s t . m o u s e w h e e l _ s c r o l l s t e p ; i + + )   { 
 
                                 s c r o l l u p _ s p v ( a c t _ p l s ,   1 ) ; 
 
                         } ; 
 
                         w i n d o w . R e p a i n t ( ) ; 
 
                 }   e l s e   { 
 
                         f o r ( v a r   i = 0 ; i < l i s t . m o u s e w h e e l _ s c r o l l s t e p ; i + + )   { 
 
                                 s c r o l l d o w n _ s p v ( a c t _ p l s ,   1 ) ; 
 
                         } ; 
 
                         w i n d o w . R e p a i n t ( ) ; 
 
                 } ; 
 
         }   e l s e   i f ( d e l t a > 0 )   { 
 
                 f o r ( i = 0 ; i < d e l t a ; i + + )   { 
 
                         s c r o l l u p _ s p v ( a c t _ p l s ,   1 ) ; 
 
                 } ; 
 
                 w i n d o w . R e p a i n t ( ) ; 
 
         }   e l s e   { 
 
                 f o r ( i = 0 ; i < a b s _ d e l t a ; i + + )   { 
 
                         s c r o l l d o w n _ s p v ( a c t _ p l s ,   1 ) ; 
 
                 } ; 
 
                 w i n d o w . R e p a i n t ( ) ; 
 
         } ; 
 
 i f ( u t i l s . I s K e y P r e s s e d ( 0 x 1 1 ) ) { 
 
                 p p t . f o n t _ s i z e   + =   d e l t a ; 
 
                 i f ( p p t . f o n t _ s i z e   >   6 0 ) 
 
                         p p t . f o n t _ s i z e   =   6 0 ; 
 
                 e l s e   i f ( p p t . f o n t _ s i z e   <   9 ) 
 
                         p p t . f o n t _ s i z e   =   9 ; 
 
                 w i n d o w . S e t P r o p e r t y ( " _ P R O P E R T Y :   F o n t   s i z e " , p p t . f o n t _ s i z e ) ; 
 
                 r o w . h   =   M a t h . f l o o r ( p p t . f o n t _ s i z e * 2 5 / 1 1 ) ; 
 
                 w i n d o w . S e t P r o p e r t y ( " S Y S T E M . r o w . h e i g h t " ,   r o w . h ) ; 
 
                 o n _ s i z e ( ) ; 
 
                 
 
                 r e d r a w _ s t u b _ i m a g e s ( ) ; 
 
                 g _ i m a g e _ c a c h e   =   n e w   i m a g e _ c a c h e ; 
 
                 C o l l e c t G a r b a g e ( ) ; 
 
                 r e f r e s h _ p l a y l i s t _ c o n t e n t ( ) ; 
 
                 
 
                 / / w i n d o w . R e p a i n t ( ) ; 
 
                 r e t u r n ; 
 
         } 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 } ; 
 
 
 
 f u n c t i o n   o n _ m o u s e _ l e a v e ( )   { 
 
         
 
         / /   c h e c k   b u t t o n s 
 
         i f ( l i s t . t o t a l > 0 )   { 
 
                 c u r s o r . b t . c h e c k s t a t e ( " l e a v e " ,   0 ,   0 ) ; 
 
         } ; 
 
         f o r ( v a r   i   i n   v s c r o l l b a r . a r r _ b u t t o n s )   { 
 
                 v s c r o l l b a r . a r r _ b u t t o n s [ i ] . c h e c k s t a t e ( " l e a v e " ,   0 ,   0 ) ; 
 
         } ; 
 
         f o r ( v a r   j   i n   t o o l b a r . b u t t o n s )   { 
 
                 t o o l b a r . b u t t o n s [ j ] . c h e c k s t a t e ( " l e a v e " ,   0 ,   0 ) ; 
 
         } ; 
 
 
 
         v a r   l e n   =   l i s t . i t e m . l e n g t h ; 
 
         r o w . b u t t o n s _ h o v e r   =   f a l s e ; 
 
         f o r ( i = 0 ; i < l e n ; i + + )   { 
 
                 l i s t . i t e m [ i ] . c h e c k s t a t e ( " l e a v e " ,   0 ,   0 ,   i ) ; 
 
         } ; 
 
 
 
         / /   t o o l b a r   i s   t o   h i d e   i f   v i s i b l e   o r   a m o r c e d 
 
         i f ( t o o l b a r . d e l t a = = 0 )   { 
 
                 t o o l b a r . t i m e r I D _ o n   & &   w i n d o w . C l e a r T i m e o u t ( t o o l b a r . t i m e r I D _ o n ) ; 
 
                 t o o l b a r . t i m e r I D _ o n   =   f a l s e ; 
 
         } ; 
 
         i f ( ! t o o l b a r . l o c k   & &   ! g _ d r a g )   { 
 
                 i f ( ! g _ m e n u _ d i s p l a y e d )   { 
 
                         i f ( ! t o o l b a r . t i m e r I D _ o f f )   { 
 
                                 t o o l b a r . t i m e r I D _ o f f   =   w i n d o w . S e t T i m e o u t ( f u n c t i o n ( )   { 
 
                                         i f ( ! t o o l b a r . t i m e r I D 2 )   { 
 
                                                 t o o l b a r . t i m e r I D 2   =   w i n d o w . S e t I n t e r v a l ( f u n c t i o n ( )   { 
 
                                                         t o o l b a r . d e l t a   - =   t o o l b a r . s t e p ; 
 
                                                         i f ( t o o l b a r . d e l t a   < =   0 )   { 
 
                                                                 t o o l b a r . d e l t a   =   0 ; 
 
                                                                 t o o l b a r . s t a t e   =   f a l s e ; 
 
                                                                 w i n d o w . C l e a r I n t e r v a l ( t o o l b a r . t i m e r I D 2 ) ; 
 
                                                                 t o o l b a r . t i m e r I D 2   =   f a l s e ; 
 
                                                         } ; 
 
                                                         w i n d o w . R e p a i n t R e c t ( 0 ,   0 ,   w w ,   t o o l b a r . c o l l a p s e d _ y * - 1 + 5 ) ; 
 
                                                 } ,   3 0 ) ; 
 
                                         }   ; 
 
                                         t o o l b a r . t i m e r I D _ o f f   & &   w i n d o w . C l e a r T i m e o u t ( t o o l b a r . t i m e r I D _ o f f ) ; 
 
                                         t o o l b a r . t i m e r I D _ o f f   =   f a l s e ; 
 
                                 } ,   4 0 0 ) ; 
 
                         } ;       
 
                 } ; 
 
         } ; 
 
         l b d n   =   0 ; 
 
         w i n d o w . R e p a i n t ( ) ; 
 
 } ; 
 
 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = / /   C a l l b a c k s 
 
 
 
 f u n c t i o n   r e f r e s h _ p l a y l i s t _ c o n t e n t ( )   { 
 
         i n i t _ a c t i v e _ p l s ( ) ; 
 
         v a r   a c t _ p l s   =   p l m a n . A c t i v e P l a y l i s t ; 
 
         l i s t . f o c u s _ i d   =   p l m a n . G e t P l a y l i s t F o c u s I t e m I n d e x ( a c t _ p l s ) ; 
 
         r e f r e s h _ s p v ( a c t _ p l s ,   t r u e ) ; 
 
         v s c r o l l b a r . w   =   v s c r o l l b a r . v i s i b l e ? v s c r o l l b a r . d e f a u l t _ w : 0 ; 
 
         w i n d o w . R e p a i n t ( ) ; 
 
 } ; 
 
 
 
 f u n c t i o n   o n _ p l a y l i s t _ s w i t c h ( )   { 
 
         i f ( i s Q u e u e P l a y l i s t A c t i v e ( ) )   { 
 
                 S h o w P l a y l i s t Q u e u e ( 0 ) ; 
 
         }   e l s e   { 
 
                 / /   t e s t   i f   t h e r e   i s   a n   a c t i v e   p l a y l i s t   f o c u s e d   ( m a y   h a p p e n   w h e n y o u   d e l e t e   a   p l a y l i s t   f r o m   p l   m a n a g e r ) 
 
                 v a r   a c t _ p l s   =   p l m a n . A c t i v e P l a y l i s t ; 
 
                 v a r   p l s _ c o u n t   =   p l m a n . P l a y l i s t C o u n t ; 
 
                 i f ( a c t _ p l s   <   0   | |   a c t _ p l s   >   p l s _ c o u n t )   { 
 
                         i f ( p l s _ c o u n t > 0 )   { 
 
                                 a c t _ p l s   =   0 ; 
 
                                 p l m a n . A c t i v e P l a y l i s t   =   0 ; 
 
                         } ; 
 
                 } ; 
 
                 r e f r e s h _ p l a y l i s t _ c o n t e n t ( ) ; 
 
         } ; 
 
 } ; 
 
 
 
 f u n c t i o n   o n _ p l a y l i s t _ i t e m s _ a d d e d ( p l a y l i s t _ i d x )   { 
 
         i f ( p l a y l i s t _ i d x = = p l m a n . A c t i v e P l a y l i s t )   { 
 
                 / /   t i m e r   t o   a v o i d   f r e e z e   d u e   t o   m a n y   t r a c k s   a d d e d   a t   t h e   s a m e   t i m e ,   w i t h   t h i s   t w e a k s ,   r e f r e s h   w i l l   b e   d o n e   w h e n   l a s t   i t e m   a d d e d   o n l y ! 
 
                 i f ( g _ a d d _ i t e m s _ t i m e r I D )   { 
 
                         g _ a d d _ i t e m s _ t i m e r I D   & &   w i n d o w . C l e a r T i m e o u t ( g _ a d d _ i t e m s _ t i m e r I D ) ; 
 
                         g _ a d d _ i t e m s _ t i m e r I D   =   f a l s e ; 
 
                 }   e l s e   { 
 
                         g _ a d d _ i t e m s _ t i m e r I D   =   w i n d o w . S e t T i m e o u t ( f u n c t i o n ( )   { 
 
                                 r e f r e s h _ p l a y l i s t _ c o n t e n t ( ) ; 
 
                                 p l m a n . S e t A c t i v e P l a y l i s t C o n t e x t ( ) ; 
 
                                 g _ a d d _ i t e m s _ t i m e r I D   & &   w i n d o w . C l e a r T i m e o u t ( g _ a d d _ i t e m s _ t i m e r I D ) ; 
 
                                 g _ a d d _ i t e m s _ t i m e r I D   =   f a l s e ; 
 
                         } ,   2 5 0 ) ; 
 
                 } ; 
 
         } ; 
 
 } ; 
 
 
 
 f u n c t i o n   o n _ p l a y l i s t _ i t e m s _ r e m o v e d ( p l a y l i s t _ i d x ,   n e w _ c o u n t )   { 
 
         i f ( p l a y l i s t _ i d x = = p l m a n . A c t i v e P l a y l i s t )   { 
 
                 r e f r e s h _ p l a y l i s t _ c o n t e n t ( ) ; 
 
         } ; 
 
         p l m a n . S e t A c t i v e P l a y l i s t C o n t e x t ( ) ; 
 
 } ; 
 
 
 
 f u n c t i o n   o n _ p l a y l i s t _ i t e m s _ r e o r d e r e d ( p l a y l i s t _ i d x )   { 
 
         i f ( p l a y l i s t _ i d x = = p l m a n . A c t i v e P l a y l i s t )   { 
 
                 r e f r e s h _ p l a y l i s t _ c o n t e n t ( ) ; 
 
         } ; 
 
 } ; 
 
 
 
 f u n c t i o n   o n _ s e l e c t i o n _ c h a n g e d ( m e t a d b )   { 
 
 } ; 
 
 
 
 f u n c t i o n   o n _ p l a y l i s t _ i t e m s _ s e l e c t i o n _ c h a n g e ( )   { 
 
         w i n d o w . R e p a i n t ( ) ; 
 
 } ; 
 
 
 
 f u n c t i o n   o n _ i t e m _ f o c u s _ c h a n g e ( p l a y l i s t ,   f r o m ,   t o )   { 
 
         i f ( ! w w   | |   ! w h )   r e t u r n   t r u e ; 
 
         i f ( t o < 0 )   {   / /   a f t e r   a   r e m o v e   i t e m   i n   p l a y l i s t ! 
 
                 r e t u r n   t r u e ; 
 
         } ; 
 
         i f ( p l a y l i s t ! = p l m a n . A c t i v e P l a y l i s t )   {   / /   c a s e   o f   t h e   i t e m   p l a y e d   w a s   f r o m   t h e   q u e u e   b u t   w a s   t h e   l a s t   q u e u e d   s o   n o w   q u e u e   i s   e m p t y 
 
                 r e t u r n   t r u e ; 
 
         } ; 
 
         l i s t . f o c u s _ i d   =   t o ; 
 
         p l m a n . S e t A c t i v e P l a y l i s t C o n t e x t ( ) ; 
 
         r e f r e s h _ s p v ( p l m a n . A c t i v e P l a y l i s t ,   b o o l _ o n _ s i z e ) ; 
 
         b o o l _ o n _ s i z e   =   f a l s e ; 
 
         w i n d o w . R e p a i n t ( ) ; 
 
 } ; 
 
 
 
 f u n c t i o n   o n _ m e t a d b _ c h a n g e d ( m e t a d b _ o r _ m e t a d b s ,   f r o m h o o k )   { 
 
         v a r   l e n   =   l i s t . i t e m . l e n g t h ; 
 
         f o r ( v a r   i = 0 ; i < l e n ; i + + )   { 
 
                 l i s t . i t e m [ i ] . u p d a t e _ i n f o s ( ) ; 
 
         } ; 
 
         w i n d o w . R e p a i n t ( ) ; 
 
 } ; 
 
 
 
 f u n c t i o n   o n _ f o c u s ( i s _ f o c u s e d )   { 
 
         i f ( i s _ f o c u s e d )   { 
 
                 p l m a n . S e t A c t i v e P l a y l i s t C o n t e x t ( ) ; 
 
         }   e l s e   { 
 
                 g _ t o o l t i p . D e a c t i v a t e ( ) ; 
 
                 g _ t o o l t i p . T r a c k A c t i v a t e   =   f a l s e ; 
 
                 g _ t o o l t i p . T e x t = " " ; 
 
                 g _ t o o l t i p _ t i m e r   & &   w i n d o w . C l e a r T i m e o u t ( g _ t o o l t i p _ t i m e r ) ; 
 
                 g _ t o o l t i p _ t i m e r   =   w i n d o w . S e t T i m e o u t ( f u n c t i o n ( )   { 
 
                         g _ t o o l t i p _ t i m e r   & &   w i n d o w . C l e a r T i m e o u t ( g _ t o o l t i p _ t i m e r ) ; 
 
                         g _ t o o l t i p _ t i m e r   =   f a l s e ; 
 
                 } ,   5 0 0 ) ; 
 
         } ; 
 
 } ; 
 
 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = / /   K e y b o a r d   C a l l b a c k s 
 
 f u n c t i o n   o n _ k e y _ u p ( v k e y )   { 
 
         v s c r o l l b a r . s t e p   =   v s c r o l l b a r . d e f a u l t _ s t e p ; 
 
         / /   s c r o l l   k e y s   u p   a n d   d o w n   R E S E T   ( s t e p   a n d   t i m e r s ) 
 
         l i s t . k e y p r e s s e d   =   f a l s e ; 
 
         s c r o l l b a r b t . t i m e r I D 1   & &   w i n d o w . C l e a r T i m e o u t ( s c r o l l b a r b t . t i m e r I D 1 ) ; 
 
         s c r o l l b a r b t . t i m e r I D 1   =   f a l s e ; 
 
         s c r o l l b a r b t . t i m e r I D 2   & &   w i n d o w . C l e a r T i m e o u t ( s c r o l l b a r b t . t i m e r I D 2 ) ; 
 
         s c r o l l b a r b t . t i m e r I D 2   =   f a l s e ; 
 
         i f ( v k e y = = V K _ S H I F T )   { 
 
                 l i s t . S H I F T _ s t a r t _ i d   =   n u l l ; 
 
                 l i s t . S H I F T _ c o u n t   =   0 ; 
 
         } ; 
 
 } ; 
 
 
 
 f u n c t i o n   o n _ k e y _ d o w n ( v k e y )   { 
 
         
 
         i f ( d r a g n d r o p . d r a g _ i n )   r e t u r n   t r u e ; 
 
         
 
         v a r   m a s k   =   G e t K e y b o a r d M a s k ( ) ; 
 
         v a r   a c t _ p l s   =   p l m a n . A c t i v e P l a y l i s t ; 
 
         
 
         i f   ( m a s k   = =   K M a s k . n o n e )   { 
 
                 s w i t c h   ( v k e y )   { 
 
                 c a s e   V K _ S H I F T : 
 
                         l i s t . S H I F T _ c o u n t   =   0 ; 
 
                         b r e a k ; 
 
                 c a s e   V K _ B A C K : 
 
                         i f ( g _ s e a r c h _ s t r i n g . l e n g t h > 0 )   { 
 
                                 v a r   t t _ x   =   ( ( w w - v s c r o l l b a r . w )   /   2 )   -   ( ( ( g _ s e a r c h _ s t r i n g . l e n g t h * 1 3 ) + ( 1 0 * 2 ) )   /   2 ) ; 
 
                                 v a r   t t _ y   =   ( w h / 2 )   -   3 0 ; 
 
                                 v a r   t t _ w   =   ( ( g _ s e a r c h _ s t r i n g . l e n g t h * 1 3 ) + ( 1 0 * 2 ) ) ; 
 
                                 v a r   t t _ h   =   8 0 ; 
 
                                 g _ s e a r c h _ s t r i n g   =   g _ s e a r c h _ s t r i n g . s u b s t r i n g ( 0 ,   g _ s e a r c h _ s t r i n g . l e n g t h - 1 ) ; 
 
                                 w i n d o w . R e p a i n t R e c t ( 0 ,   t t _ y - 2 ,   w w - v s c r o l l b a r . w ,   t t _ h + 4 ) ; 
 
                                 c l e a r _ i n c s e a r c h _ t i m e r   & &   w i n d o w . C l e a r I n t e r v a l ( c l e a r _ i n c s e a r c h _ t i m e r ) ; 
 
                                 i n c s e a r c h _ t i m e r   & &   w i n d o w . C l e a r T i m e o u t ( i n c s e a r c h _ t i m e r ) ; 
 
                                 i n c s e a r c h _ t i m e r   =   w i n d o w . S e t T i m e o u t ( f u n c t i o n   ( )   { 
 
                                         I n c r e m e n t a l S e a r c h ( ) ; 
 
                                         i n c s e a r c h _ t i m e r   =   f a l s e ; 
 
                                 } ,   4 0 0 ) ; 
 
                         } ; 
 
                         b r e a k ; 
 
                 c a s e   V K _ E S C A P E : 
 
                 c a s e   2 2 2 : 
 
                         v a r   t t _ x   =   ( ( w w - v s c r o l l b a r . w )   /   2 )   -   ( ( ( g _ s e a r c h _ s t r i n g . l e n g t h * 1 3 ) + ( 1 0 * 2 ) )   /   2 ) ; 
 
                         v a r   t t _ y   =   ( w h / 2 )   -   3 0 ; 
 
                         v a r   t t _ w   =   ( ( g _ s e a r c h _ s t r i n g . l e n g t h * 1 3 ) + ( 1 0 * 2 ) ) ; 
 
                         v a r   t t _ h   =   8 0 ; 
 
                         g _ s e a r c h _ s t r i n g   =   " " ; 
 
                         w i n d o w . R e p a i n t R e c t ( 0 ,   t t _ y - 2 ,   w w - v s c r o l l b a r . w ,   t t _ h + 4 ) ; 
 
                         b r e a k ; 
 
                 c a s e   V K _ U P : 
 
                         v a r   n e w _ f o c u s _ i d   =   0 ; 
 
                         i f ( ! l i s t . k e y p r e s s e d )   { 
 
                                 l i s t . k e y p r e s s e d   =   t r u e ; 
 
                                 r e s e t _ c o v e r _ t i m e r s ( ) ; 
 
                                 n e w _ f o c u s _ i d   =   ( l i s t . f o c u s _ i d > 0 ) ? l i s t . f o c u s _ i d - 1 : 0 ; 
 
                                 p l m a n . S e t P l a y l i s t F o c u s I t e m ( a c t _ p l s ,   n e w _ f o c u s _ i d ) ; 
 
                                 p l m a n . C l e a r P l a y l i s t S e l e c t i o n ( a c t _ p l s ) ; 
 
                                 p l m a n . S e t P l a y l i s t S e l e c t i o n S i n g l e ( a c t _ p l s ,   n e w _ f o c u s _ i d ,   t r u e ) ; 
 
                                 s c r o l l b a r b t . t i m e r I D 1   =   w i n d o w . S e t T i m e o u t ( f u n c t i o n   ( )   { 
 
                                         s c r o l l b a r b t . t i m e r I D 1   & &   w i n d o w . C l e a r T i m e o u t ( s c r o l l b a r b t . t i m e r I D 1 ) ; 
 
                                         s c r o l l b a r b t . t i m e r I D 1   =   f a l s e ; 
 
                                         s c r o l l b a r b t . t i m e r I D 2   & &   w i n d o w . C l e a r I n t e r v a l ( s c r o l l b a r b t . t i m e r I D 2 ) ; 
 
                                         s c r o l l b a r b t . t i m e r I D 2   =   w i n d o w . S e t I n t e r v a l ( f u n c t i o n   ( )   { 
 
                                                 n e w _ f o c u s _ i d   =   ( l i s t . f o c u s _ i d > 0 ) ? l i s t . f o c u s _ i d - 1 : 0 ; 
 
                                                 p l m a n . S e t P l a y l i s t F o c u s I t e m ( a c t _ p l s ,   n e w _ f o c u s _ i d ) ; 
 
                                                 p l m a n . C l e a r P l a y l i s t S e l e c t i o n ( a c t _ p l s ) ; 
 
                                                 p l m a n . S e t P l a y l i s t S e l e c t i o n S i n g l e ( a c t _ p l s ,   n e w _ f o c u s _ i d ,   t r u e ) ; 
 
                                         } ,   s c r o l l b a r b t . t i m e r 2 _ v a l u e + 5 ) ; 
 
                                 } ,   s c r o l l b a r b t . t i m e r 1 _ v a l u e ) ; 
 
                         } 
 
                         b r e a k ; 
 
                 c a s e   V K _ D O W N : 
 
                         v a r   n e w _ f o c u s _ i d   =   0 ; 
 
                         i f ( ! l i s t . k e y p r e s s e d )   { 
 
                                 l i s t . k e y p r e s s e d   =   t r u e ; 
 
                                 r e s e t _ c o v e r _ t i m e r s ( ) ; 
 
                                 n e w _ f o c u s _ i d   =   ( l i s t . f o c u s _ i d < l i s t . t o t a l - 1 ) ? l i s t . f o c u s _ i d + 1 : l i s t . t o t a l - 1 ; 
 
                                 p l m a n . S e t P l a y l i s t F o c u s I t e m ( a c t _ p l s ,   n e w _ f o c u s _ i d ) ; 
 
                                 p l m a n . C l e a r P l a y l i s t S e l e c t i o n ( a c t _ p l s ) ; 
 
                                 p l m a n . S e t P l a y l i s t S e l e c t i o n S i n g l e ( a c t _ p l s ,   n e w _ f o c u s _ i d ,   t r u e ) ; 
 
                                 s c r o l l b a r b t . t i m e r I D 1   =   w i n d o w . S e t T i m e o u t ( f u n c t i o n   ( )   { 
 
                                         s c r o l l b a r b t . t i m e r I D 1   & &   w i n d o w . C l e a r T i m e o u t ( s c r o l l b a r b t . t i m e r I D 1 ) ; 
 
                                         s c r o l l b a r b t . t i m e r I D 1   =   f a l s e ; 
 
                                         s c r o l l b a r b t . t i m e r I D 2   & &   w i n d o w . C l e a r I n t e r v a l ( s c r o l l b a r b t . t i m e r I D 2 ) ; 
 
                                         s c r o l l b a r b t . t i m e r I D 2   =   w i n d o w . S e t I n t e r v a l ( f u n c t i o n   ( )   { 
 
                                                 n e w _ f o c u s _ i d   =   ( l i s t . f o c u s _ i d < l i s t . t o t a l - 1 ) ? l i s t . f o c u s _ i d + 1 : l i s t . t o t a l - 1 ; 
 
                                                 p l m a n . S e t P l a y l i s t F o c u s I t e m ( a c t _ p l s ,   n e w _ f o c u s _ i d ) ; 
 
                                                 p l m a n . C l e a r P l a y l i s t S e l e c t i o n ( a c t _ p l s ) ; 
 
                                                 p l m a n . S e t P l a y l i s t S e l e c t i o n S i n g l e ( a c t _ p l s ,   n e w _ f o c u s _ i d ,   t r u e ) ; 
 
                                         } ,   s c r o l l b a r b t . t i m e r 2 _ v a l u e + 5 ) ; 
 
                                 } ,   s c r o l l b a r b t . t i m e r 1 _ v a l u e ) ; 
 
                         } ; 
 
                         b r e a k ; 
 
                 c a s e   V K _ P G U P : 
 
                         v a r   d e l t a   =   0 ; 
 
                         v a r   s t e p   =   0 ; 
 
                         v a r   n e w _ f o c u s _ i d   =   0 ; 
 
                         i f ( ! l i s t . k e y p r e s s e d )   { 
 
                                 l i s t . k e y p r e s s e d   =   t r u e ; 
 
                                 r e s e t _ c o v e r _ t i m e r s ( ) ; 
 
                                 d e l t a   =   l i s t . t o c u t ; 
 
                                 s t e p   =   l i s t . f o c u s _ i d   -   l i s t . i t e m [ d e l t a ] . i d ; 
 
                                 n e w _ f o c u s _ i d   =   ( l i s t . f o c u s _ i d - s t e p - 1 > 0 ) ? l i s t . f o c u s _ i d - s t e p - 1 : 0 ; 
 
                                 l i s t . f o c u s _ i d   =   n e w _ f o c u s _ i d ; 
 
                                 p l m a n . C l e a r P l a y l i s t S e l e c t i o n ( a c t _ p l s ) ; 
 
                                 p l m a n . S e t P l a y l i s t S e l e c t i o n S i n g l e ( a c t _ p l s ,   n e w _ f o c u s _ i d ,   t r u e ) ; 
 
                                 p l m a n . S e t P l a y l i s t F o c u s I t e m ( a c t _ p l s ,   n e w _ f o c u s _ i d ) ; 
 
                                 s c r o l l b a r b t . t i m e r I D 1   =   w i n d o w . S e t T i m e o u t ( f u n c t i o n   ( )   { 
 
                                         s c r o l l b a r b t . t i m e r I D 1   & &   w i n d o w . C l e a r T i m e o u t ( s c r o l l b a r b t . t i m e r I D 1 ) ; 
 
                                         s c r o l l b a r b t . t i m e r I D 1   =   f a l s e ; 
 
                                         s c r o l l b a r b t . t i m e r I D 2   & &   w i n d o w . C l e a r I n t e r v a l ( s c r o l l b a r b t . t i m e r I D 2 ) ; 
 
                                         s c r o l l b a r b t . t i m e r I D 2   =   w i n d o w . S e t I n t e r v a l ( f u n c t i o n   ( )   { 
 
                                                 d e l t a   =   l i s t . t o c u t ; 
 
                                                 s t e p   =   l i s t . f o c u s _ i d   -   l i s t . i t e m [ d e l t a ] . i d ; 
 
                                                 n e w _ f o c u s _ i d   =   ( l i s t . f o c u s _ i d - s t e p - 1 > 0 ) ? l i s t . f o c u s _ i d - s t e p - 1 : 0 ; 
 
                                                 p l m a n . S e t P l a y l i s t F o c u s I t e m ( a c t _ p l s ,   n e w _ f o c u s _ i d ) ; 
 
                                                 p l m a n . C l e a r P l a y l i s t S e l e c t i o n ( a c t _ p l s ) ; 
 
                                                 p l m a n . S e t P l a y l i s t S e l e c t i o n S i n g l e ( a c t _ p l s ,   n e w _ f o c u s _ i d ,   t r u e ) ; 
 
                                         } ,   s c r o l l b a r b t . t i m e r 2 _ v a l u e + 3 0 ) ; 
 
                                 } ,   s c r o l l b a r b t . t i m e r 1 _ v a l u e ) ; 
 
                         } ; 
 
                         b r e a k ; 
 
                 c a s e   V K _ P G D N : 
 
                         v a r   d e l t a   =   0 ; 
 
                         v a r   s t e p   =   0 ; 
 
                         v a r   n e w _ f o c u s _ i d   =   0 ; 
 
                         i f ( ! l i s t . k e y p r e s s e d )   { 
 
                                 l i s t . k e y p r e s s e d   =   t r u e ; 
 
                                 r e s e t _ c o v e r _ t i m e r s ( ) ; 
 
                                 d e l t a   =   ( l i s t . t o c u t + l i s t . n b v i s < l i s t . i t e m . l e n g t h ) ? l i s t . t o c u t + l i s t . n b v i s : l i s t . i t e m . l e n g t h - 1 ; 
 
                                 s t e p   =   l i s t . i t e m [ d e l t a ] . i d   -   l i s t . f o c u s _ i d ; 
 
                                 n e w _ f o c u s _ i d   =   ( l i s t . f o c u s _ i d < l i s t . t o t a l - 1 - s t e p ) ? l i s t . f o c u s _ i d + s t e p : l i s t . t o t a l - 1 ; 
 
                                 l i s t . f o c u s _ i d   =   n e w _ f o c u s _ i d ; 
 
                                 p l m a n . C l e a r P l a y l i s t S e l e c t i o n ( a c t _ p l s ) ; 
 
                                 p l m a n . S e t P l a y l i s t S e l e c t i o n S i n g l e ( a c t _ p l s ,   n e w _ f o c u s _ i d ,   t r u e ) ; 
 
                                 p l m a n . S e t P l a y l i s t F o c u s I t e m ( a c t _ p l s ,   n e w _ f o c u s _ i d ) ; 
 
                                 s c r o l l b a r b t . t i m e r I D 1   =   w i n d o w . S e t T i m e o u t ( f u n c t i o n   ( )   { 
 
                                         s c r o l l b a r b t . t i m e r I D 1   & &   w i n d o w . C l e a r T i m e o u t ( s c r o l l b a r b t . t i m e r I D 1 ) ; 
 
                                         s c r o l l b a r b t . t i m e r I D 1   =   f a l s e ; 
 
                                         s c r o l l b a r b t . t i m e r I D 2   & &   w i n d o w . C l e a r I n t e r v a l ( s c r o l l b a r b t . t i m e r I D 2 ) ; 
 
                                         s c r o l l b a r b t . t i m e r I D 2   =   w i n d o w . S e t I n t e r v a l ( f u n c t i o n   ( )   { 
 
                                                 d e l t a   =   ( l i s t . t o c u t + l i s t . n b v i s < l i s t . i t e m . l e n g t h ) ? l i s t . t o c u t + l i s t . n b v i s : l i s t . i t e m . l e n g t h - 1 ; 
 
                                                 s t e p   =   l i s t . i t e m [ d e l t a ] . i d   -   l i s t . f o c u s _ i d ; 
 
                                                 n e w _ f o c u s _ i d   =   ( l i s t . f o c u s _ i d < l i s t . t o t a l - 1 - s t e p ) ? l i s t . f o c u s _ i d + s t e p : l i s t . t o t a l - 1 ; 
 
                                                 p l m a n . S e t P l a y l i s t F o c u s I t e m ( a c t _ p l s ,   n e w _ f o c u s _ i d ) ; 
 
                                                 p l m a n . C l e a r P l a y l i s t S e l e c t i o n ( a c t _ p l s ) ; 
 
                                                 p l m a n . S e t P l a y l i s t S e l e c t i o n S i n g l e ( a c t _ p l s ,   n e w _ f o c u s _ i d ,   t r u e ) ; 
 
                                         } ,   s c r o l l b a r b t . t i m e r 2 _ v a l u e + 3 0 ) ; 
 
                                 } ,   s c r o l l b a r b t . t i m e r 1 _ v a l u e ) ; 
 
                         } ; 
 
                         b r e a k ; 
 
                 c a s e   V K _ R E T U R N : 
 
                         / /   p l a y   f o c u s   i t e m 
 
                         i f ( ! i s Q u e u e P l a y l i s t A c t i v e ( ) )   { 
 
                                 p l m a n . E x e c u t e P l a y l i s t D e f a u l t A c t i o n ( a c t _ p l s ,   l i s t . f o c u s _ i d ) ; 
 
                         } ; 
 
                         b r e a k ; 
 
                 c a s e   V K _ E N D : 
 
                         p l m a n . S e t P l a y l i s t F o c u s I t e m ( a c t _ p l s ,   l i s t . t o t a l - 1 ) ; 
 
                         p l m a n . C l e a r P l a y l i s t S e l e c t i o n ( a c t _ p l s ) ; 
 
                         p l m a n . S e t P l a y l i s t S e l e c t i o n S i n g l e ( a c t _ p l s ,   l i s t . t o t a l - 1 ,   t r u e ) ; 
 
                         b r e a k ; 
 
                 c a s e   V K _ H O M E : 
 
                         p l m a n . S e t P l a y l i s t F o c u s I t e m ( a c t _ p l s ,   0 ) ; 
 
                         p l m a n . C l e a r P l a y l i s t S e l e c t i o n ( a c t _ p l s ) ; 
 
                         p l m a n . S e t P l a y l i s t S e l e c t i o n S i n g l e ( a c t _ p l s ,   0 ,   t r u e ) ; 
 
                         b r e a k ; 
 
                 c a s e   V K _ D E L E T E : 
 
                         i f ( ! f b . I s A u t o P l a y l i s t ( a c t _ p l s ) )   { 
 
                                 i f ( i s Q u e u e P l a y l i s t A c t i v e ( ) )   { 
 
                                         v a r   a f f e c t e d _ i t e m s   =   A r r a y ( ) ; 
 
                                         v a r   f i r s t _ f o c u s _ i d   =   n u l l ; 
 
                                         v a r   n e x t _ f o c u s _ i d   =   n u l l ; 
 
                                         f o r ( v a r   k = 0 ;   k < l i s t . t o t a l ;   k + + )   { 
 
                                                 i f ( p l m a n . I s P l a y l i s t I t e m S e l e c t e d ( a c t _ p l s ,   k ) )   { 
 
                                                         a f f e c t e d _ i t e m s . p u s h ( k ) ; 
 
                                                         i f ( f i r s t _ f o c u s _ i d = = n u l l )   f i s t _ f o c u s _ i d   =   k ; 
 
                                                         n e x t _ f o c u s _ i d   =   k   +   1 ; 
 
                                                 } ; 
 
                                         } ; 
 
                                         i f ( n e x t _ f o c u s _ i d > = l i s t . t o t a l )   { 
 
                                                 n e x t _ f o c u s _ i d   =   f i s t _ f o c u s _ i d ; 
 
                                         } ; 
 
                                         i f ( n e x t _ f o c u s _ i d ! = n u l l )   { 
 
                                                 p l m a n . S e t P l a y l i s t F o c u s I t e m ( a c t _ p l s ,   n e x t _ f o c u s _ i d ) ; 
 
                                                 p l m a n . S e t P l a y l i s t S e l e c t i o n S i n g l e ( a c t _ p l s ,   n e x t _ f o c u s _ i d ,   t r u e ) ; 
 
                                         } ; 
 
                                         p l m a n . R e m o v e I t e m s F r o m P l a y b a c k Q u e u e ( a f f e c t e d _ i t e m s ) ; 
 
                                 }   e l s e   { 
 
                                         p l m a n . R e m o v e P l a y l i s t S e l e c t i o n ( a c t _ p l s ,   f a l s e ) ; 
 
                                 } ; 
 
                                 p l m a n . S e t P l a y l i s t S e l e c t i o n S i n g l e ( a c t _ p l s ,   p l m a n . G e t P l a y l i s t F o c u s I t e m I n d e x ( a c t _ p l s ) ,   t r u e ) ; 
 
                         } ; 
 
                         b r e a k ; 
 
                 } ; 
 
         }   e l s e   { 
 
                 s w i t c h ( m a s k )   { 
 
                         c a s e   K M a s k . s h i f t : 
 
                                 i f ( v k e y = = V K _ U P )   {   / /   S H I F T   +   K E Y   U P 
 
                                         i f ( l i s t . S H I F T _ c o u n t = = 0 )   { 
 
                                                 i f ( l i s t . S H I F T _ s t a r t _ i d = = n u l l )   { 
 
                                                         l i s t . S H I F T _ s t a r t _ i d   =   l i s t . f o c u s _ i d ; 
 
                                                 } ; 
 
                                                 p l m a n . C l e a r P l a y l i s t S e l e c t i o n ( a c t _ p l s ) ; 
 
                                                 p l m a n . S e t P l a y l i s t S e l e c t i o n S i n g l e ( a c t _ p l s ,   l i s t . f o c u s _ i d ,   t r u e ) ; 
 
                                                 i f ( l i s t . f o c u s _ i d > 0 )   { 
 
                                                         l i s t . S H I F T _ c o u n t - - ; 
 
                                                         l i s t . f o c u s _ i d - - ; 
 
                                                         p l m a n . S e t P l a y l i s t S e l e c t i o n S i n g l e ( a c t _ p l s ,   l i s t . f o c u s _ i d ,   t r u e ) ; 
 
                                                         p l m a n . S e t P l a y l i s t F o c u s I t e m ( a c t _ p l s ,   l i s t . f o c u s _ i d ) ; 
 
                                                 } ; 
 
                                         }   e l s e   i f ( l i s t . S H I F T _ c o u n t < 0 )   { 
 
                                                 i f ( l i s t . f o c u s _ i d > 0 )   { 
 
                                                         l i s t . S H I F T _ c o u n t - - ; 
 
                                                         l i s t . f o c u s _ i d - - ; 
 
                                                         p l m a n . S e t P l a y l i s t S e l e c t i o n S i n g l e ( a c t _ p l s ,   l i s t . f o c u s _ i d ,   t r u e ) ; 
 
                                                         p l m a n . S e t P l a y l i s t F o c u s I t e m ( a c t _ p l s ,   l i s t . f o c u s _ i d ) ; 
 
                                                 } ; 
 
                                         }   e l s e   { 
 
                                                 p l m a n . S e t P l a y l i s t S e l e c t i o n S i n g l e ( a c t _ p l s ,   l i s t . f o c u s _ i d ,   f a l s e ) ; 
 
                                                 l i s t . S H I F T _ c o u n t - - ; 
 
                                                 l i s t . f o c u s _ i d - - ; 
 
                                                 p l m a n . S e t P l a y l i s t F o c u s I t e m ( a c t _ p l s ,   l i s t . f o c u s _ i d ) ; 
 
                                         } ; 
 
                                 } ; 
 
                                 i f ( v k e y = = V K _ D O W N )   {   / /   S H I F T   +   K E Y   D O W N 
 
                                         i f ( l i s t . S H I F T _ c o u n t = = 0 )   { 
 
                                                 i f ( l i s t . S H I F T _ s t a r t _ i d = = n u l l )   { 
 
                                                         l i s t . S H I F T _ s t a r t _ i d   =   l i s t . f o c u s _ i d ; 
 
                                                 } ; 
 
                                                 p l m a n . C l e a r P l a y l i s t S e l e c t i o n ( a c t _ p l s ) ; 
 
                                                 p l m a n . S e t P l a y l i s t S e l e c t i o n S i n g l e ( a c t _ p l s ,   l i s t . f o c u s _ i d ,   t r u e ) ; 
 
                                                 i f ( l i s t . f o c u s _ i d < l i s t . t o t a l - 1 )   { 
 
                                                         l i s t . S H I F T _ c o u n t + + ; 
 
                                                         l i s t . f o c u s _ i d + + ; 
 
                                                         p l m a n . S e t P l a y l i s t S e l e c t i o n S i n g l e ( a c t _ p l s ,   l i s t . f o c u s _ i d ,   t r u e ) ; 
 
                                                         p l m a n . S e t P l a y l i s t F o c u s I t e m ( a c t _ p l s ,   l i s t . f o c u s _ i d ) ; 
 
                                                 } ; 
 
                                         }   e l s e   i f ( l i s t . S H I F T _ c o u n t > 0 )   { 
 
                                                 i f ( l i s t . f o c u s _ i d < l i s t . t o t a l - 1 )   { 
 
                                                         l i s t . S H I F T _ c o u n t + + ; 
 
                                                         l i s t . f o c u s _ i d + + ; 
 
                                                         p l m a n . S e t P l a y l i s t S e l e c t i o n S i n g l e ( a c t _ p l s ,   l i s t . f o c u s _ i d ,   t r u e ) ; 
 
                                                         p l m a n . S e t P l a y l i s t F o c u s I t e m ( a c t _ p l s ,   l i s t . f o c u s _ i d ) ; 
 
                                                 } ; 
 
                                         }   e l s e   { 
 
                                                 p l m a n . S e t P l a y l i s t S e l e c t i o n S i n g l e ( a c t _ p l s ,   l i s t . f o c u s _ i d ,   f a l s e ) ; 
 
                                                 l i s t . S H I F T _ c o u n t + + ; 
 
                                                 l i s t . f o c u s _ i d + + ; 
 
                                                 p l m a n . S e t P l a y l i s t F o c u s I t e m ( a c t _ p l s ,   l i s t . f o c u s _ i d ) ; 
 
                                         } ; 
 
                                 } ; 
 
                                 b r e a k ; 
 
                         c a s e   K M a s k . c t r l : 
 
                                 i f ( v k e y = = 6 5 )   {   / /   C T R L + A 
 
                                         f b . R u n M a i n M e n u C o m m a n d ( " E d i t / S e l e c t   a l l " ) ; 
 
                                         w i n d o w . R e p a i n t ( ) ; 
 
                                 } ; 
 
                                 i f ( v k e y = = 6 7 )   {   / /   C T R L + C 
 
                                         c l i p b o a r d . s e l e c t i o n   =   p l m a n . G e t P l a y l i s t S e l e c t e d I t e m s ( p l m a n . A c t i v e P l a y l i s t ) ; 
 
                                 } ; 
 
                                 i f ( v k e y = = 8 6 )   {   / /   C T R L + V 
 
                                         / /   i n s e r t   t h e   c l i p b o a r d   s e l e c t i o n   ( h a n d l e s )   a f t e r   t h e   c u r r e n t   p o s i t i o n   i n   t h e   a c t i v e   p l a y l i s t 
 
                                         i f ( c l i p b o a r d . s e l e c t i o n )   { 
 
                                                 i f ( c l i p b o a r d . s e l e c t i o n . C o u n t > 0 )   { 
 
                                                         t r y   { 
 
                                                                 i f ( l i s t . t o t a l > 0 )   { 
 
                                                                         p l m a n . I n s e r t P l a y l i s t I t e m s ( p l m a n . A c t i v e P l a y l i s t ,   l i s t . f o c u s _ i d + 1 ,   c l i p b o a r d . s e l e c t i o n ) ; 
 
                                                                 }   e l s e   { 
 
                                                                         p l m a n . I n s e r t P l a y l i s t I t e m s ( p l m a n . A c t i v e P l a y l i s t ,   0 ,   c l i p b o a r d . s e l e c t i o n ) ; 
 
                                                                 } ; 
 
                                                         }   c a t c h ( e )   { 
 
                                                                 f b . t r a c e ( " W S H   P l a y l i s t   W A R N I N G :   C l i p b o a r d   c a n ' t   b e   p a s t e ,   i n v a l i d   c l i p b o a r d   c o n t e n t . " ) ; 
 
                                                         } ; 
 
                                                 } ; 
 
                                         } ; 
 
                                 } ; 
 
                                 i f ( v k e y = = 7 0 )   {   / /   C T R L + F 
 
                                         f b . R u n M a i n M e n u C o m m a n d ( " E d i t / S e a r c h " ) ; 
 
                                 } ; 
 
                                 i f ( v k e y = = 7 8 )   {   / /   C T R L + N 
 
                                         f b . R u n M a i n M e n u C o m m a n d ( " F i l e / N e w   p l a y l i s t " ) ; 
 
                                 } ; 
 
                                 i f ( v k e y = = 7 9 )   {   / /   C T R L + O 
 
                                         f b . R u n M a i n M e n u C o m m a n d ( " F i l e / O p e n . . . " ) ; 
 
                                 } ; 
 
                                 i f ( v k e y = = 8 0 )   {   / /   C T R L + P 
 
                                         f b . R u n M a i n M e n u C o m m a n d ( " F i l e / P r e f e r e n c e s " ) ; 
 
                                 } ; 
 
                                 i f ( v k e y = = 8 3 )   {   / /   C T R L + S 
 
                                         f b . R u n M a i n M e n u C o m m a n d ( " F i l e / S a v e   p l a y l i s t . . . " ) ; 
 
                                 } ; 
 
                                 b r e a k ; 
 
                         c a s e   K M a s k . a l t : 
 
                                 i f ( v k e y = = 6 5 )   {   / /   A L T + A 
 
                                         f b . R u n M a i n M e n u C o m m a n d ( " V i e w / A l w a y s   o n   T o p " ) ; 
 
                                 } ; 
 
                                 b r e a k ; 
 
                 } ; 
 
         } ; 
 
 } ; 
 
 
 
 f u n c t i o n   o n _ c h a r ( c o d e )   { 
 
         i f ( l i s t . t o t a l > 0 )   { 
 
                 v a r   t t _ x   =   ( ( w w - v s c r o l l b a r . w )   /   2 )   -   ( ( ( g _ s e a r c h _ s t r i n g . l e n g t h * 1 3 ) + ( 1 0 * 2 ) )   /   2 ) ; 
 
                 v a r   t t _ y   =   ( w h / 2 )   -   3 0 ; 
 
                 v a r   t t _ w   =   ( ( g _ s e a r c h _ s t r i n g . l e n g t h * 1 3 ) + ( 1 0 * 2 ) ) ; 
 
                 v a r   t t _ h   =   8 0 ; 
 
                 i f ( c o d e = = 3 2   & &   g _ s e a r c h _ s t r i n g . l e n g t h = = 0 )   r e t u r n   t r u e ;   / /   S P A C E   C h a r   n o t   a l l o w e d   o n   1 s t   c h a r 
 
                 i f ( g _ s e a r c h _ s t r i n g . l e n g t h < = 2 0   & &   t t _ w < = w w - v s c r o l l b a r . w - 2 0 )   { 
 
                         i f   ( c o d e   >   3 1 )   { 
 
                                 g _ s e a r c h _ s t r i n g   =   g _ s e a r c h _ s t r i n g   +   S t r i n g . f r o m C h a r C o d e ( c o d e ) . t o U p p e r C a s e ( ) ; 
 
                                 w i n d o w . R e p a i n t R e c t ( 0 ,   t t _ y - 2 ,   w w ,   t t _ h + 4 ) ; 
 
                                 c l e a r _ i n c s e a r c h _ t i m e r   & &   w i n d o w . C l e a r I n t e r v a l ( c l e a r _ i n c s e a r c h _ t i m e r ) ; 
 
                                 c l e a r _ i n c s e a r c h _ t i m e r   =   f a l s e ; 
 
                                 i n c s e a r c h _ t i m e r   & &   w i n d o w . C l e a r T i m e o u t ( i n c s e a r c h _ t i m e r ) ; 
 
                                 i n c s e a r c h _ t i m e r   =   w i n d o w . S e t T i m e o u t ( f u n c t i o n   ( )   { 
 
                                         I n c r e m e n t a l S e a r c h ( ) ; 
 
                                         w i n d o w . C l e a r T i m e o u t ( i n c s e a r c h _ t i m e r ) ; 
 
                                         i n c s e a r c h _ t i m e r   =   f a l s e ; 
 
                                 } ,   4 0 0 ) ; 
 
                         } ; 
 
                 } ; 
 
         } ; 
 
 } ; 
 
 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = / /   P l a y b a c k   C a l l b a c k s 
 
 f u n c t i o n   o n _ p l a y b a c k _ n e w _ t r a c k ( i n f o )   { 
 
         p r o g r e s s   =   0 ; 
 
         g _ s e c o n d s   =   0 ; 
 
         g _ m e t a d b   =   f b . G e t N o w P l a y i n g ( ) ; 
 
         w i n d o w . R e p a i n t ( ) ; 
 
 } ; 
 
 
 
 f u n c t i o n   o n _ p l a y b a c k _ s t o p ( r e a s o n )   { 
 
         i f ( r e a s o n = = 0 )   {   / /   o n   u s e r   S t o p 
 
                 g _ m e t a d b   =   f b . G e t F o c u s I t e m ( ) ; 
 
                 o n _ m e t a d b _ c h a n g e d ( ) ; 
 
         } ; 
 
         p r o g r e s s   =   0 ; 
 
         g _ s e c o n d s   =   0 ; 
 
 } ; 
 
 
 
 f u n c t i o n   o n _ p l a y b a c k _ p a u s e ( s t a t e ) { 
 
 } ; 
 
 
 
 f u n c t i o n   o n _ p l a y b a c k _ s e e k ( t i m e )   { 
 
         o n _ p l a y b a c k _ t i m e ( t i m e ) ; 
 
 } ; 
 
 
 
 f u n c t i o n   o n _ p l a y b a c k _ t i m e ( t i m e )   { 
 
         / /   r e f r e s h   n o w   p l a y i n g   t r a c k   i n   t h e   p l a y l i s t   ( p l a y   i c o n   +   t i m e   e l a p s e d / r e m a i n i n g ) 
 
         g _ s e c o n d s   =   t i m e ; 
 
         i f ( g _ p l a y i n g _ i t e m _ y ! = n u l l   & &   p l m a n . P l a y i n g P l a y l i s t = = p l m a n . A c t i v e P l a y l i s t )   { 
 
                 i f ( g _ p l a y i n g _ i t e m _ y > = 0 - r o w . h   & &   g _ p l a y i n g _ i t e m _ y < = w h + r o w . h )   { 
 
                         i f ( g _ p l a y i n g _ i t e m _ y < 0 )   { 
 
                                 g _ p l a y i n g _ i t e m _ y   =   0 ; 
 
                         } ; 
 
                         i f ( g _ p l a y i n g _ i t e m _ y > w h - r o w . h )   { 
 
                                 g _ p l a y i n g _ i t e m _ y   =   w h - r o w . h ; 
 
                         } ; 
 
                         w i n d o w . R e p a i n t R e c t ( 0 ,   g _ p l a y i n g _ i t e m _ y ,   w w - v s c r o l l b a r . w ,   r o w . h ) ; 
 
                 } ; 
 
         } ; 
 
         
 
         / /   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - / 
 
         / /   S t a t i s t i c s   T A G s   E n g i n e   ( v 1 . 0   b y   B r 3 t t ) 
 
         / /   U p d a t e   t h e   T A G s   b e l o w   a f t e r   5 0 %   t i m e   p l a y e d   : 
 
         / /   < F I R S T _ P L A Y E D > ,   < L A S T _ P L A Y E D > ,   < P L A Y _ C O U N T E R >   ( < P L A Y _ C O U N T >   r e p l a c e d   i f   f o u n d ) 
 
         / /   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - / 
 
         i f ( t i m e   < =   1 )   { 
 
                 s t a t s . u p d a t e d   =   f a l s e ; 
 
                 s t a t s . m e t a d b   =   f b . G e t N o w P l a y i n g ( ) ; 
 
                 s t a t s . p a t h _ p r e f i x   =   s t a t s . m e t a d b   ?   s t a t s . m e t a d b . r a w p a t h . s u b s t r i n g ( 0 , 4 )   :   " " ; 
 
                 s t a t s . t a g g a b l e _ f i l e   =   ( s t a t s . p a t h _ p r e f i x   = =   " f i l e "   | |   s t a t s . p a t h _ p r e f i x = =   " c d d a " ) ; 
 
         } ; 
 
         i f ( s t a t s . m e t a d b   & &   s t a t s . t a g g a b l e _ f i l e   & &   f b . I s M e t a d b I n M e d i a L i b r a r y ( s t a t s . m e t a d b ) )   { 
 
                 i f ( t i m e   < =   1 )   { 
 
                         v a r   t o t a l _ s e c o n d s   =   s t a t s . t f _ l e n g t h _ s e c o n d s . E v a l ( ) ; 
 
                         s t a t s . t i m e _ e l a p s e d   =   M a t h . f l o o r ( t i m e ) ; 
 
                         i f ( t o t a l _ s e c o n d s   > =   1 0 )   { 
 
                                 s t a t s . l i m i t   =   t o t a l _ s e c o n d s   -   5 ; 
 
                                 s t a t s . d e l a y   =   M a t h . f l o o r ( t o t a l _ s e c o n d s   /   2 ) ; 
 
                         }   e l s e   { 
 
                                 s t a t s . l i m i t   =   t o t a l _ s e c o n d s   -   1 ; 
 
                                 s t a t s . d e l a y   =   2 ; 
 
                         } ; 
 
                         i f ( s t a t s . d e l a y   <   0 )   s t a t s . d e l a y   =   0 ; 
 
                         
 
                 }   e l s e   i f ( s t a t s . t i m e _ e l a p s e d   >   0 )   { 
 
                         s t a t s . t i m e _ e l a p s e d + + ; 
 
                 } ; 
 
                               
 
                 i f ( s t a t s . t i m e _ e l a p s e d   > =   s t a t s . d e l a y   & &   t i m e   < =   s t a t s . l i m i t )   { 
 
                         s t a t s . t i m e _ e l a p s e d   =   0 ; 
 
 
 
                         v a r   n e w _ p l a y _ c o u n t e r ; 
 
                         v a r   o l d _ p l a y _ c o u n t ,   o l d _ p l a y _ c o u n t e r ; 
 
                         
 
                         o l d _ p l a y _ c o u n t   =   s t a t s . t f _ p l a y _ c o u n t . E v a l ( ) ; 
 
                         o l d _ p l a y _ c o u n t e r   =   s t a t s . t f _ p l a y _ c o u n t e r . E v a l ( ) ; 
 
 
 
                         v a r   t i m e s t a m p   =   g e t T i m e s t a m p ( ) ; 
 
 
 
                         i f ( o l d _ p l a y _ c o u n t   > =   0   & &   o l d _ p l a y _ c o u n t e r   = =   " ? " )   { 
 
                                 n e w _ p l a y _ c o u n t e r   =   M a t h . f l o o r ( o l d _ p l a y _ c o u n t )   +   1 ; 
 
                         }   e l s e   i f ( o l d _ p l a y _ c o u n t e r = = " ? " )   { 
 
                                 n e w _ p l a y _ c o u n t e r   =   1 ; 
 
                         }   e l s e   { 
 
                                 n e w _ p l a y _ c o u n t e r   =   M a t h . f l o o r ( o l d _ p l a y _ c o u n t e r )   +   1 ; 
 
                         } ; 
 
                         
 
                         v a r   f i r s t p l a y e d _ t s   =   s t a t s . t f _ f i r s t _ p l a y e d . E v a l ( ) ; 
 
 
 
                         / /   U P D A T E   T A G s 
 
                         i f ( s t a t s . e n a b l e d   & &   ! s t a t s . f o o _ p l a y c o u n t   & &   ! s t a t s . u p d a t e d )   { 
 
                                 i f ( f i r s t p l a y e d _ t s   ! =   " ? " )   { 
 
                                         v a r   b o o l   =   s t a t s . m e t a d b . U p d a t e F i l e I n f o S i m p l e ( " L A S T _ P L A Y E D " ,   t i m e s t a m p ,   " P L A Y _ C O U N T E R " ,   n e w _ p l a y _ c o u n t e r ,   " P L A Y _ C O U N T " ,   " " ) ; 
 
                                 }   e l s e   { 
 
                                         v a r   b o o l   =   s t a t s . m e t a d b . U p d a t e F i l e I n f o S i m p l e ( " F I R S T _ P L A Y E D " ,   t i m e s t a m p ,   " L A S T _ P L A Y E D " ,   t i m e s t a m p ,   " P L A Y _ C O U N T E R " ,   n e w _ p l a y _ c o u n t e r ,   " P L A Y _ C O U N T " ,   " " ) ; 
 
                                 } ; 
 
                                 s t a t s . u p d a t e d   =   t r u e ; 
 
                                 / /   r e p o r t   t o   c o n s o l e 
 
                                 f b . t r a c e ( " W S H :   S t a t i s t i c s   u p d a t e d   t o   f i l e   a t   :   "   +   f b . P l a y b a c k T i m e   +   " . " ) ; 
 
                         } ; 
 
                 } ; 
 
         } ; 
 
 } ; 
 
 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = / /   F o n t   &   C o l o r s 
 
 f u n c t i o n   g e t _ f o n t ( )   { 
 
 	 i f   ( g _ i n s t a n c e t y p e   = =   0 )   { 
 
 	 	 g _ f o n t   =   g d i . F o n t ( p p t . f o n t _ n a m e ,   p p t . f o n t _ s i z e ,   0 ) ; / / w i n d o w . G e t F o n t C U I ( F o n t T y p e C U I . i t e m s ,   " { 8 2 1 9 6 D 7 9 - 6 9 B C - 4 0 4 1 - 8 E 2 A - E 3 B 4 4 0 6 B B 6 F C } " ) ; 
 
 	 	 g _ f o n t _ h e a d e r s   =   g d i . F o n t ( p p t . f o n t _ h e a d e r s _ n a m e ,   p p t . f o n t _ h e a d e r s _ s i z e ,   0 ) ; / / w i n d o w . G e t F o n t C U I ( F o n t T y p e C U I . l a b e l s ,   " { C 0 D 3 B 7 6 C - 3 2 4 D - 4 6 D 3 - B B 3 C - E 8 1 C 7 D 3 B C B 8 5 } " ) ; 
 
 	 }   e l s e   i f   ( g _ i n s t a n c e t y p e   = =   1 )   { 
 
 	 	 g _ f o n t   =   w i n d o w . G e t F o n t D U I ( F o n t T y p e D U I . p l a y l i s t s ) ; 
 
 	 	 g _ f o n t _ h e a d e r s   =   w i n d o w . G e t F o n t D U I ( F o n t T y p e D U I . t a b s ) ; 
 
 	 } ; 
 
         i f ( g _ f o n t _ g u i f x _ f o u n d )   { 
 
                 r a t i n g _ f o n t   =   g d i . F o n t ( " g u i f x   v 2   t r a n s p o r t s " ,   1 7 ,   0 ) ; 
 
                 d e l _ r a t i n g _ f o n t   =   g d i . F o n t ( " g u i f x   v 2   t r a n s p o r t s " ,   1 3 ,   0 ) ; 
 
                 m o o d _ f o n t   =   g d i . F o n t ( " g u i f x   v 2   t r a n s p o r t s " ,   p p t . f o n t _ m o o d _ s i z e ,   0 ) ; 
 
         }   e l s e   { 
 
                 r a t i n g _ f o n t   =   g d i . F o n t ( " t a h o m a " ,   2 2 ,   0 ) ; 
 
                 d e l _ r a t i n g _ f o n t   =   g d i . F o n t ( " t a h o m a " ,   2 2 ,   0 ) ; 
 
                 m o o d _ f o n t   =   g d i . F o n t ( " t a h o m a " ,   1 6 ,   1 ) ; 
 
         } ; 
 
 } ; 
 
 
 
 f u n c t i o n   g e t _ c o l o r s ( )   { 
 
 	 i f   ( g _ i n s t a n c e t y p e   = =   0 )   { 
 
 	 	 g _ t e x t c o l o r   =   w i n d o w . G e t C o l o r C U I ( C o l o r T y p e C U I . t e x t ) ; 
 
 	 	 g _ t e x t c o l o r _ s e l   =   w i n d o w . G e t C o l o r C U I ( C o l o r T y p e C U I . s e l e c t i o n _ t e x t ) ; 
 
 	 	 g _ t e x t c o l o r _ h l   =   w i n d o w . G e t C o l o r C U I ( C o l o r T y p e C U I . a c t i v e _ i t e m _ f r a m e ) ; 
 
 	 	 g _ b a c k c o l o r   =   w i n d o w . G e t C o l o r C U I ( C o l o r T y p e C U I . b a c k g r o u n d ) ; 
 
 	 	 g _ b a c k c o l o r _ s e l   =   w i n d o w . G e t C o l o r C U I ( C o l o r T y p e C U I . s e l e c t i o n _ b a c k g r o u n d ) 
 
 	 }   e l s e   i f   ( g _ i n s t a n c e t y p e   = =   1 )   { 
 
 	 	 g _ t e x t c o l o r   =   w i n d o w . G e t C o l o r D U I ( C o l o r T y p e D U I . t e x t ) ; 
 
 	 	 g _ t e x t c o l o r _ s e l   =   w i n d o w . G e t C o l o r D U I ( C o l o r T y p e D U I . s e l e c t i o n ) ; 
 
 	 	 g _ t e x t c o l o r _ h l   =   w i n d o w . G e t C o l o r D U I ( C o l o r T y p e D U I . h i g h l i g h t ) ; 
 
 	 	 g _ b a c k c o l o r   =   w i n d o w . G e t C o l o r D U I ( C o l o r T y p e D U I . b a c k g r o u n d ) ; 
 
 	 	 g _ b a c k c o l o r _ s e l   =   g _ t e x t c o l o r _ s e l 
 
 	 } ; 
 
 
 
         / /   C u s t o m   c o l o r s   s e t   i n   P r o p e r t i e s   o f   t h e   p a n e l 
 
         i f ( p a n e l . c u s t o m _ c o l o r s )   { 
 
                 t r y { 
 
                         i f ( p a n e l . c u s t o m _ t e x t c o l o r . l e n g t h > 0 )   g _ t e x t c o l o r   =   e v a l ( p a n e l . c u s t o m _ t e x t c o l o r ) ; 
 
                         i f ( p a n e l . c u s t o m _ t e x t c o l o r _ s e l e c t i o n . l e n g t h > 0 )   { 
 
                                 g _ t e x t c o l o r _ s e l   =   e v a l ( p a n e l . c u s t o m _ t e x t c o l o r _ s e l e c t i o n ) ; 
 
                                 g _ b a c k c o l o r _ s e l   =   g _ t e x t c o l o r _ s e l ; 
 
                         } ; 
 
                         i f ( p a n e l . c u s t o m _ b a c k c o l o r . l e n g t h > 0 )   g _ b a c k c o l o r   =   e v a l ( p a n e l . c u s t o m _ b a c k c o l o r ) ; 
 
                         i f ( p a n e l . c u s t o m _ t e x t c o l o r _ h i g h l i g h t . l e n g t h > 0 )   g _ t e x t c o l o r _ h l   =   e v a l ( p a n e l . c u s t o m _ t e x t c o l o r _ h i g h l i g h t ) ; 
 
                 }   c a t c h ( e )   { } ; 
 
         } ; 
 
 
 
 	 g _ b a c k c o l o r _ R   =   g e t R e d ( g _ b a c k c o l o r ) ; 
 
 	 g _ b a c k c o l o r _ G   =   g e t G r e e n ( g _ b a c k c o l o r ) ; 
 
 	 g _ b a c k c o l o r _ B   =   g e t B l u e ( g _ b a c k c o l o r ) 
 
 } ; 
 
 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = / /   I m a g e s   ( g e n e r a l ) 
 
 f u n c t i o n   s e t _ s c r o l l e r ( )   { 
 
         v a r   g b ; 
 
         
 
         t r y   { 
 
                 c u r s o r . i m g _ n o r m a l   =   g d i . C r e a t e I m a g e ( c u r s o r . w ,   c u r s o r . h ) ; 
 
         }   c a t c h ( e )   { 
 
                 c u r s o r . h   =   c u r s o r . d e f a u l t _ h ; 
 
                 c u r s o r . i m g _ n o r m a l   =   g d i . C r e a t e I m a g e ( c u r s o r . w ,   c u r s o r . h ) ; 
 
         } ; 
 
         
 
         g b   =   c u r s o r . i m g _ n o r m a l . G e t G r a p h i c s ( ) ; 
 
         / /   D r a w   T h e m e d   S c r o l l b a r   ( l g / c o l ) 
 
         t r y   { 
 
                 v s c r o l l b a r . t h e m e . S e t P a r t A n d S t a t e I d ( 3 ,   1 ) ; 
 
                 v s c r o l l b a r . t h e m e . D r a w T h e m e B a c k g r o u n d ( g b ,   0 ,   0 ,   c u r s o r . w ,   c u r s o r . h ) ; 
 
         }   c a t c h ( e )   { 
 
                 g b . F i l l S o l i d R e c t ( 3 ,   0 ,   c u r s o r . w - 6 ,   c u r s o r . h ,   g _ t e x t c o l o r & 0 x 4 4 f f f f f f ) ; 
 
         } ; 
 
         c u r s o r . i m g _ n o r m a l . R e l e a s e G r a p h i c s ( g b ) ; 
 
 
 
         c u r s o r . i m g _ h o v e r   =   g d i . C r e a t e I m a g e ( c u r s o r . w ,   c u r s o r . h ) ; 
 
         g b   =   c u r s o r . i m g _ h o v e r . G e t G r a p h i c s ( ) ; 
 
         / /   D r a w   T h e m e d   S c r o l l b a r   ( l g / c o l ) 
 
         t r y   { 
 
                 v s c r o l l b a r . t h e m e . S e t P a r t A n d S t a t e I d ( 3 ,   2 ) ; 
 
                 v s c r o l l b a r . t h e m e . D r a w T h e m e B a c k g r o u n d ( g b ,   0 ,   0 ,   c u r s o r . w ,   c u r s o r . h ) ; 
 
         }   c a t c h ( e )   { 
 
                 g b . F i l l S o l i d R e c t ( 3 ,   0 ,   c u r s o r . w - 6 ,   c u r s o r . h ,   g _ t e x t c o l o r & 0 x 8 8 f f f f f f ) ; 
 
         } ; 
 
         c u r s o r . i m g _ h o v e r . R e l e a s e G r a p h i c s ( g b ) ; 
 
         c u r s o r . b t   =   n e w   b u t t o n ( c u r s o r . i m g _ n o r m a l ,   c u r s o r . i m g _ h o v e r ,   c u r s o r . i m g _ h o v e r ) ; 
 
 } ; 
 
 
 
 f u n c t i o n   i n i t _ v s c r o l l b a r _ b u t t o n s ( )   { 
 
         v a r   i ,   g b ; 
 
 
 
         c u r s o r . p o p u p   =   g d i . C r e a t e I m a g e ( 2 7 ,   2 2 ) ; 
 
         g b   =   c u r s o r . p o p u p . G e t G r a p h i c s ( ) ; 
 
         g b . S e t S m o o t h i n g M o d e ( 2 ) ; 
 
         g b . F i l l R o u n d R e c t ( 0 , 0 , 2 2 - 1 , 2 2 - 1 , 3 , 3 , g _ t e x t c o l o r ) ; 
 
         g b . D r a w R o u n d R e c t ( 0 , 0 , 2 2 - 1 , 2 2 - 1 , 3 , 3 , 1 . 0 , R G B A ( 0 , 0 , 0 , 1 5 0 ) ) ; 
 
         v a r   p o i n t s   =   A r r a y ( 2 2 - 2 , 7 ,   2 2 - 2 + 6 , 1 1 ,   2 2 - 2 , 2 2 - 7 ) ; 
 
         g b . F i l l P o l y g o n ( g _ t e x t c o l o r ,   0 ,   p o i n t s ) ; 
 
         g b . D r a w P o l y g o n ( R G B A ( 0 , 0 , 0 , 1 5 0 ) ,   1 . 0 ,   p o i n t s ) ; 
 
         g b . S e t S m o o t h i n g M o d e ( 0 ) ; 
 
         g b . F i l l S o l i d R e c t ( 2 2 - 4 , 6 , 3 , 2 2 - 1 0 , g _ t e x t c o l o r ) ; 
 
         c u r s o r . p o p u p . R e l e a s e G r a p h i c s ( g b ) ; 
 
         
 
         b u t t o n _ u p . i m g _ n o r m a l   =   g d i . C r e a t e I m a g e ( b u t t o n _ u p . w ,   b u t t o n _ u p . h ) ; 
 
         g b   =   b u t t o n _ u p . i m g _ n o r m a l . G e t G r a p h i c s ( ) ; 
 
         / /   D r a w   T h e m e d   S c r o l l b a r   ( l g / c o l ) 
 
         t r y   { 
 
                 v s c r o l l b a r . t h e m e . S e t P a r t A n d S t a t e I d ( 1 ,   1 ) ; 
 
                 v s c r o l l b a r . t h e m e . D r a w T h e m e B a c k g r o u n d ( g b ,   0 ,   0 ,   b u t t o n _ u p . w ,   b u t t o n _ u p . h ) ; 
 
         }   c a t c h ( e )   { 
 
                 g b . S e t S m o o t h i n g M o d e ( 2 ) ; 
 
                 v a r   m i d _ x   =   M a t h . r o u n d ( b u t t o n _ u p . w / 2 ) ; 
 
                 g b . D r a w L i n e ( m i d _ x - 4 ,   1 0 ,   m i d _ x + 0 ,   5 ,   2 . 0 ,   g _ t e x t c o l o r & 0 x 4 4 f f f f f f ) ; 
 
                 g b . D r a w L i n e ( m i d _ x + 0 ,   6 ,   m i d _ x + 3 ,   1 0 ,   2 . 0 ,   g _ t e x t c o l o r & 0 x 4 4 f f f f f f ) ; 
 
         } ; 
 
         b u t t o n _ u p . i m g _ n o r m a l . R e l e a s e G r a p h i c s ( g b ) ; 
 
 
 
         b u t t o n _ u p . i m g _ h o v e r   =   g d i . C r e a t e I m a g e ( b u t t o n _ u p . w ,   b u t t o n _ u p . h ) ; 
 
         g b   =   b u t t o n _ u p . i m g _ h o v e r . G e t G r a p h i c s ( ) ; 
 
         / /   D r a w   T h e m e d   S c r o l l b a r   ( l g / c o l ) 
 
         t r y   { 
 
                 v s c r o l l b a r . t h e m e . S e t P a r t A n d S t a t e I d ( 1 ,   2 ) ; 
 
                 v s c r o l l b a r . t h e m e . D r a w T h e m e B a c k g r o u n d ( g b ,   0 ,   0 ,   b u t t o n _ u p . w ,   b u t t o n _ u p . h ) ; 
 
         }   c a t c h ( e )   { 
 
                 g b . S e t S m o o t h i n g M o d e ( 2 ) ; 
 
                 v a r   m i d _ x   =   M a t h . r o u n d ( b u t t o n _ u p . w / 2 ) ; 
 
                 g b . D r a w L i n e ( m i d _ x - 4 ,   1 0 ,   m i d _ x + 0 ,   5 ,   2 . 0 ,   g _ t e x t c o l o r & 0 x 8 8 f f f f f f ) ; 
 
                 g b . D r a w L i n e ( m i d _ x + 0 ,   6 ,   m i d _ x + 3 ,   1 0 ,   2 . 0 ,   g _ t e x t c o l o r & 0 x 8 8 f f f f f f ) ; 
 
         } ; 
 
         b u t t o n _ u p . i m g _ h o v e r . R e l e a s e G r a p h i c s ( g b ) ; 
 
 
 
         b u t t o n _ u p . i m g _ d o w n   =   g d i . C r e a t e I m a g e ( b u t t o n _ u p . w ,   b u t t o n _ u p . h ) ; 
 
         g b   =   b u t t o n _ u p . i m g _ d o w n . G e t G r a p h i c s ( ) ; 
 
         / /   D r a w   T h e m e d   S c r o l l b a r   ( l g / c o l ) 
 
         t r y   { 
 
                 v s c r o l l b a r . t h e m e . S e t P a r t A n d S t a t e I d ( 1 ,   3 ) ; 
 
                 v s c r o l l b a r . t h e m e . D r a w T h e m e B a c k g r o u n d ( g b ,   0 ,   0 ,   b u t t o n _ u p . w ,   b u t t o n _ u p . h ) ; 
 
         }   c a t c h ( e )   { 
 
                 g b . S e t S m o o t h i n g M o d e ( 2 ) ; 
 
                 v a r   m i d _ x   =   M a t h . r o u n d ( b u t t o n _ u p . w / 2 ) ; 
 
                 g b . D r a w L i n e ( m i d _ x - 4 ,   1 0 ,   m i d _ x + 0 ,   5 ,   2 . 0 ,   g _ t e x t c o l o r ) ; 
 
                 g b . D r a w L i n e ( m i d _ x + 0 ,   6 ,   m i d _ x + 3 ,   1 0 ,   2 . 0 ,   g _ t e x t c o l o r ) ; 
 
         } ; 
 
         b u t t o n _ u p . i m g _ d o w n . R e l e a s e G r a p h i c s ( g b ) ; 
 
 
 
         b u t t o n _ d o w n . i m g _ n o r m a l   =   g d i . C r e a t e I m a g e ( b u t t o n _ d o w n . w ,   b u t t o n _ d o w n . h ) ; 
 
         g b   =   b u t t o n _ d o w n . i m g _ n o r m a l . G e t G r a p h i c s ( ) ; 
 
         / /   D r a w   T h e m e d   S c r o l l b a r   ( l g / c o l ) 
 
         t r y   { 
 
                 v s c r o l l b a r . t h e m e . S e t P a r t A n d S t a t e I d ( 1 ,   5 ) ; 
 
                 v s c r o l l b a r . t h e m e . D r a w T h e m e B a c k g r o u n d ( g b ,   0 ,   0 ,   b u t t o n _ d o w n . w ,   b u t t o n _ d o w n . h ) ; 
 
         }   c a t c h ( e )   { 
 
                 g b . S e t S m o o t h i n g M o d e ( 2 ) ; 
 
                 v a r   m i d _ x   =   M a t h . r o u n d ( b u t t o n _ u p . w / 2 ) ; 
 
                 g b . D r a w L i n e ( m i d _ x - 4 ,   b u t t o n _ d o w n . h - 1 1 ,   m i d _ x + 0 ,   b u t t o n _ d o w n . h - 6 ,   2 . 0 ,   g _ t e x t c o l o r & 0 x 4 4 f f f f f f ) ; 
 
                 g b . D r a w L i n e ( m i d _ x + 0 ,   b u t t o n _ d o w n . h - 7 ,   m i d _ x + 3 ,   b u t t o n _ d o w n . h - 1 1 ,   2 . 0 ,   g _ t e x t c o l o r & 0 x 4 4 f f f f f f ) ; 
 
         } ; 
 
         b u t t o n _ d o w n . i m g _ n o r m a l . R e l e a s e G r a p h i c s ( g b ) ; 
 
 
 
         b u t t o n _ d o w n . i m g _ h o v e r   =   g d i . C r e a t e I m a g e ( b u t t o n _ d o w n . w ,   b u t t o n _ d o w n . h ) ; 
 
         g b   =   b u t t o n _ d o w n . i m g _ h o v e r . G e t G r a p h i c s ( ) ; 
 
         / /   D r a w   T h e m e d   S c r o l l b a r   ( l g / c o l ) 
 
         t r y   { 
 
                 v s c r o l l b a r . t h e m e . S e t P a r t A n d S t a t e I d ( 1 ,   6 ) ; 
 
                 v s c r o l l b a r . t h e m e . D r a w T h e m e B a c k g r o u n d ( g b ,   0 ,   0 ,   b u t t o n _ d o w n . w ,   b u t t o n _ d o w n . h ) ; 
 
         }   c a t c h ( e )   { 
 
                 g b . S e t S m o o t h i n g M o d e ( 2 ) ; 
 
                 v a r   m i d _ x   =   M a t h . r o u n d ( b u t t o n _ u p . w / 2 ) ; 
 
                 g b . D r a w L i n e ( m i d _ x - 4 ,   b u t t o n _ d o w n . h - 1 1 ,   m i d _ x + 0 ,   b u t t o n _ d o w n . h - 6 ,   2 . 0 ,   g _ t e x t c o l o r & 0 x 8 8 f f f f f f ) ; 
 
                 g b . D r a w L i n e ( m i d _ x + 0 ,   b u t t o n _ d o w n . h - 7 ,   m i d _ x + 3 ,   b u t t o n _ d o w n . h - 1 1 ,   2 . 0 ,   g _ t e x t c o l o r & 0 x 8 8 f f f f f f ) ; 
 
         } ; 
 
         b u t t o n _ d o w n . i m g _ h o v e r . R e l e a s e G r a p h i c s ( g b ) ; 
 
 
 
         b u t t o n _ d o w n . i m g _ d o w n   =   g d i . C r e a t e I m a g e ( b u t t o n _ d o w n . w ,   b u t t o n _ d o w n . h ) ; 
 
         g b   =   b u t t o n _ d o w n . i m g _ d o w n . G e t G r a p h i c s ( ) ; 
 
         / /   D r a w   T h e m e d   S c r o l l b a r   ( l g / c o l ) 
 
         t r y   { 
 
                 v s c r o l l b a r . t h e m e . S e t P a r t A n d S t a t e I d ( 1 ,   7 ) ; 
 
                 v s c r o l l b a r . t h e m e . D r a w T h e m e B a c k g r o u n d ( g b ,   0 ,   0 ,   b u t t o n _ d o w n . w ,   b u t t o n _ d o w n . h ) ; 
 
         }   c a t c h ( e )   { 
 
                 g b . S e t S m o o t h i n g M o d e ( 2 ) ; 
 
                 v a r   m i d _ x   =   M a t h . r o u n d ( b u t t o n _ u p . w / 2 ) ; 
 
                 g b . D r a w L i n e ( m i d _ x - 4 ,   b u t t o n _ d o w n . h - 1 1 ,   m i d _ x + 0 ,   b u t t o n _ d o w n . h - 6 ,   2 . 0 ,   g _ t e x t c o l o r ) ; 
 
                 g b . D r a w L i n e ( m i d _ x + 0 ,   b u t t o n _ d o w n . h - 7 ,   m i d _ x + 3 ,   b u t t o n _ d o w n . h - 1 1 ,   2 . 0 ,   g _ t e x t c o l o r ) ; 
 
         } ; 
 
         b u t t o n _ d o w n . i m g _ d o w n . R e l e a s e G r a p h i c s ( g b ) ; 
 
 
 
         v s c r o l l b a r . a r r _ b u t t o n s . s p l i c e ( 0 ,   v s c r o l l b a r . a r r _ b u t t o n s . l e n g t h ) ; 
 
         f o r ( i = 0 ; i < v s c r o l l b a r . b u t t o n _ t o t a l ; i + + )   { 
 
                 s w i t c h ( i )   { 
 
                   c a s e   0 : 
 
                         v s c r o l l b a r . a r r _ b u t t o n s . p u s h ( n e w   b u t t o n ( b u t t o n _ u p . i m g _ n o r m a l ,   b u t t o n _ u p . i m g _ h o v e r ,   b u t t o n _ u p . i m g _ d o w n ) ) ; 
 
                         b r e a k ; 
 
                   c a s e   1 : 
 
                         v s c r o l l b a r . a r r _ b u t t o n s . p u s h ( n e w   b u t t o n ( b u t t o n _ d o w n . i m g _ n o r m a l ,   b u t t o n _ d o w n . i m g _ h o v e r ,   b u t t o n _ d o w n . i m g _ d o w n ) ) ; 
 
                         b r e a k ;                         
 
                 } ; 
 
         } ; 
 
 } ; 
 
 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = / /   I n i t   I c o n s   a n d   I m a g e s   ( n o _ c o v e r   . . . ) 
 
 f u n c t i o n   i n i t _ i c o n s ( )   { 
 
         v a r   i ; 
 
         v a r   g b ; 
 
         v a r   g u i _ f o n t   =   g d i . F o n t ( " g u i f x   v 2   t r a n s p o r t s " ,   1 5 ,   0 ) ; 
 
         
 
         g l a s s _ r e f l e c t _ i m g   =   d r a w _ g l a s s _ r e f l e c t ( 1 2 0 ,   1 2 0 ) ; 
 
         
 
         p l a y i c o n _ o f f   =   g d i . C r e a t e I m a g e ( 2 0 ,   r o w . h ) ; 
 
         g b   =   p l a y i c o n _ o f f . G e t G r a p h i c s ( ) ; 
 
         g b . S e t S m o o t h i n g M o d e ( 2 ) ; 
 
         v a r   x 1   =   0 ; 
 
         v a r   y 1   =   M a t h . f l o o r ( r o w . h / 2 )   -   1 0 ; / / 6 
 
         v a r   x 2   =   1 8 ; / / 1 2 
 
         v a r   y 2   =   M a t h . f l o o r ( r o w . h / 2 ) ; 
 
         v a r   x 3   =   0 ; 
 
         v a r   y 3   =   M a t h . f l o o r ( r o w . h / 2 )   +   1 0 ; / / 6 
 
         v a r   p o i n t s   =   A r r a y ( x 1 ,   y 1 ,   x 2 ,   y 2 ,   x 3 ,   y 3 ) ; 
 
         g b . F i l l P o l y g o n ( g _ b a c k c o l o r ,   0 ,   p o i n t s ) ; 
 
         g b . D r a w P o l y g o n ( g _ t e x t c o l o r ,   1 . 0 ,   p o i n t s ) ; 
 
         g b . S e t S m o o t h i n g M o d e ( 0 ) ; 
 
         p l a y i c o n _ o f f . R e l e a s e G r a p h i c s ( g b ) ; 
 
 
 
         p l a y i c o n _ o n   =   g d i . C r e a t e I m a g e ( 2 0 ,   r o w . h ) ; 
 
         g b   =   p l a y i c o n _ o n . G e t G r a p h i c s ( ) ; 
 
         g b . S e t S m o o t h i n g M o d e ( 2 ) ; 
 
         v a r   x 1   =   0 ; 
 
         v a r   y 1   =   M a t h . f l o o r ( r o w . h / 2 )   -   1 0 ; / / 6 
 
         v a r   x 2   =   1 8 ; / / 1 2 
 
         v a r   y 2   =   M a t h . f l o o r ( r o w . h / 2 ) ; 
 
         v a r   x 3   =   0 ; 
 
         v a r   y 3   =   M a t h . f l o o r ( r o w . h / 2 )   +   1 0 ; / / 6 
 
         v a r   p o i n t s   =   A r r a y ( x 1 ,   y 1 ,   x 2 ,   y 2 ,   x 3 ,   y 3 ) ;         g b . F i l l P o l y g o n ( g _ b a c k c o l o r ,   0 ,   p o i n t s ) ; 
 
         g b . F i l l P o l y g o n ( g _ b a c k c o l o r ,   0 ,   p o i n t s ) ; 
 
         g b . F i l l P o l y g o n ( p p t . p l a y _ i c o n _ c o l o r & R G B A ( 2 5 5 , 2 5 5 , 2 5 5 , p p t . p l a y _ i c o n _ c o l o r _ a l p h a ) ,   0 ,   p o i n t s ) ; / / g _ t e x t c o l o r _ s e l & 0 x 9 9 f f f f f f ,   0 ,   p o i n t s ) ; / / 
 
         g b . D r a w P o l y g o n ( g _ t e x t c o l o r ,   1 . 0 ,   p o i n t s ) ; 
 
         g b . S e t S m o o t h i n g M o d e ( 0 ) ; 
 
         p l a y i c o n _ o n . R e l e a s e G r a p h i c s ( g b ) ; 
 
         
 
         / /   s i n g l e l i n e   g r o u p   h e a d e r   i c o n   
 
         s i n g l e l i n e _ g r o u p _ h e a d e r _ i c o n   =   g d i . C r e a t e I m a g e ( 1 8 ,   1 6 ) ; 
 
         g b   =   s i n g l e l i n e _ g r o u p _ h e a d e r _ i c o n . G e t G r a p h i c s ( ) ; 
 
         g b . S e t S m o o t h i n g M o d e ( 2 ) ; 
 
         g b . D r a w E l l i p s e ( 1 , 2 , 1 2 , 1 2 , 1 . 0 , g _ t e x t c o l o r _ h l & 0 x 9 9 f f f f f f ) ; 
 
         g b . F i l l E l l i p s e ( 3 , 4 , 8 , 8 , g _ t e x t c o l o r & 0 x 5 5 f f f f f f ) ; 
 
         s i n g l e l i n e _ g r o u p _ h e a d e r _ i c o n . R e l e a s e G r a p h i c s ( g b ) ; 
 
     
 
         / /   d r a g _ n _ d r o p   m a r k e r s   a r o u n d   l i n e   o f   i n s e r t 
 
         i c o n _ a r r o w _ l e f t   =   g d i . C r e a t e I m a g e ( 8 ,   8 ) ; 
 
         g b   =   i c o n _ a r r o w _ l e f t . G e t G r a p h i c s ( ) ; 
 
         g b . S e t S m o o t h i n g M o d e ( 0 ) ; 
 
         g b . D r a w L i n e ( 0 ,   0 ,   0 ,   7 ,   1 . 0 ,   g _ t e x t c o l o r ) ; 
 
         g b . D r a w L i n e ( 1 ,   1 ,   1 ,   7 - 1 ,   1 . 0 ,   g _ t e x t c o l o r ) ; 
 
         g b . D r a w L i n e ( 2 ,   2 ,   2 ,   7 - 2 ,   1 . 0 ,   g _ t e x t c o l o r ) ; 
 
         g b . D r a w L i n e ( 3 ,   3 ,   3 ,   7 - 3 ,   1 . 0 ,   g _ t e x t c o l o r ) ; 
 
         i c o n _ a r r o w _ l e f t . R e l e a s e G r a p h i c s ( g b ) ; 
 
 
 
         n o c o v e r   =   g d i . C r e a t e I m a g e ( 2 0 0 ,   2 0 0 ) ; 
 
         g b   =   n o c o v e r . G e t G r a p h i c s ( ) ; 
 
         g b . S e t S m o o t h i n g M o d e ( 2 ) ; 
 
         g b . F i l l S o l i d R e c t ( 0 , 0 , 2 0 0 , 2 0 0 , g _ t e x t c o l o r ) ; 
 
         g b . F i l l G r a d R e c t ( 0 , 0 , 2 0 0 , 2 0 0 , 9 0 , g _ b a c k c o l o r & 0 x b b f f f f f f , g _ b a c k c o l o r , 1 . 0 ) ; 
 
         g b . S e t T e x t R e n d e r i n g H i n t ( 3 ) ; 
 
         g u i _ f o n t   =   g d i . F o n t ( " S e g o e   U I " ,   1 0 8 ,   1 ) ; 
 
         g b . D r a w S t r i n g ( " N O " ,   g u i _ f o n t ,   g _ t e x t c o l o r & 0 x 2 5 f f f f f f ,   0 ,   0 ,   2 0 0 ,   1 1 0 ,   c c _ s t r i n g f o r m a t ) ; 
 
         g u i _ f o n t   =   g d i . F o n t ( " S e g o e   U I " ,   4 8 ,   1 ) ; 
 
         g b . D r a w S t r i n g ( " C O V E R " ,   g u i _ f o n t ,   g _ t e x t c o l o r & 0 x 2 0 f f f f f f ,   1 ,   7 0 ,   2 0 0 ,   1 1 0 ,   c c _ s t r i n g f o r m a t ) ; 
 
         g b . F i l l S o l i d R e c t ( 2 4 ,   1 5 5 ,   1 5 2 ,   2 0 ,   g _ t e x t c o l o r & 0 x 1 5 f f f f f f ) ; 
 
         n o c o v e r . R e l e a s e G r a p h i c s ( g b ) ; 
 
         
 
         n o a r t i s t   =   g d i . C r e a t e I m a g e ( 2 0 0 ,   2 0 0 ) ; 
 
         g b   =   n o a r t i s t . G e t G r a p h i c s ( ) ; 
 
         g b . S e t S m o o t h i n g M o d e ( 2 ) ; 
 
         g b . F i l l S o l i d R e c t ( 0 , 0 , 2 0 0 , 2 0 0 , g _ t e x t c o l o r ) ; 
 
         g b . F i l l G r a d R e c t ( 0 , 0 , 2 0 0 , 2 0 0 , 9 0 , g _ b a c k c o l o r & 0 x b b f f f f f f , g _ b a c k c o l o r , 1 . 0 ) ; 
 
         g b . F i l l E l l i p s e ( 1 0 0 - 9 0 / 2 , 1 1 0 , 1 5 0 , 3 0 0 , g _ t e x t c o l o r & 0 x 2 5 f f f f f f ) ; 
 
         g b . F i l l E l l i p s e ( 1 0 0 - 9 0 / 2 , 2 5 , 9 0 , 9 0 , g _ t e x t c o l o r & 0 x 2 5 f f f f f f ) ; 
 
         n o a r t i s t . R e l e a s e G r a p h i c s ( g b ) ; 
 
 
 
         s t r e a m c o v e r   =   g d i . C r e a t e I m a g e ( 2 0 0 ,   2 0 0 ) ; 
 
         g b   =   s t r e a m c o v e r . G e t G r a p h i c s ( ) ; 
 
         g b . S e t S m o o t h i n g M o d e ( 2 ) ; 
 
         g b . F i l l S o l i d R e c t ( 0 , 0 , 2 0 0 , 2 0 0 , g _ t e x t c o l o r ) ; 
 
         g b . F i l l G r a d R e c t ( 0 , 0 , 2 0 0 , 2 0 0 , 9 0 , g _ b a c k c o l o r & 0 x b b f f f f f f , g _ b a c k c o l o r , 1 . 0 ) ; 
 
         g u i _ f o n t   =   g d i . F o n t ( " S e g o e   U I " ,   4 2 ,   0 ) ; 
 
         g b . S e t T e x t R e n d e r i n g H i n t ( 3 ) ; 
 
         g b . D r a w S t r i n g ( " s t r e a m " ,   g u i _ f o n t ,   g _ b a c k c o l o r ,   1 ,   2 ,   2 0 0 ,   1 9 0 ,   c c _ s t r i n g f o r m a t ) ; 
 
         g b . D r a w S t r i n g ( " s t r e a m " ,   g u i _ f o n t ,   g _ t e x t c o l o r & 0 x 9 9 f f f f f f ,   1 ,   0 ,   2 0 0 ,   1 9 0 ,   c c _ s t r i n g f o r m a t ) ; 
 
         s t r e a m c o v e r . R e l e a s e G r a p h i c s ( g b ) ; 
 
 
 
         / /   T o o l b a r   b u t t o n s 
 
         
 
         / /   S e t t i n g s   M e n u   b u t t o n 
 
         b t _ s e t t i n g s _ o f f   =   g d i . C r e a t e I m a g e ( 3 0 ,   3 0 ) ; 
 
         g b   =   b t _ s e t t i n g s _ o f f . G e t G r a p h i c s ( ) ; 
 
         g u i _ f o n t   =   g d i . F o n t ( " S e g o e   M D L 2   A s s e t s " ,   2 0 ,   1 ) ; 
 
         g b . S e t T e x t R e n d e r i n g H i n t ( 3 ) ; 
 
         g b . D r a w S t r i n g ( " " ,   g u i _ f o n t ,   R G B ( 1 5 0 , 1 5 0 , 1 5 0 ) ,   0 ,   2 ,   2 0 ,   2 0 ,   l c _ s t r i n g f o r m a t ) ; 
 
         / / g b . S e t S m o o t h i n g M o d e ( 2 ) ; 
 
         / / g b . F i l l E l l i p s e ( 2 , 3 , 1 2 , 1 0 , R G B ( 1 4 0 , 1 4 0 , 1 4 0 ) ) ; 
 
         / / g b . D r a w E l l i p s e ( 5 , 5 , 6 , 6 , 2 . 0 , R G B A ( 0 , 0 , 0 , 2 0 0 ) ) ; 
 
         / / g b . D r a w E l l i p s e ( 2 , 3 , 1 2 , 1 0 , 1 . 0 , R G B A ( 0 , 0 , 0 , 8 0 ) ) ; 
 
         / / g b . S e t S m o o t h i n g M o d e ( 0 ) ; 
 
         / / g b . D r a w L i n e ( 1 6 + 8 - 4 ,   8 - 2 + 2 ,   1 6 + 8 + 4 ,   8 - 2 + 2 ,   1 . 0 ,   R G B ( 1 4 0 , 1 4 0 , 1 4 0 ) ) ; 
 
         / / g b . D r a w L i n e ( 1 6 + 8 - 3 ,   8 - 1 + 2 ,   1 6 + 8 + 3 ,   8 - 1 + 2 ,   1 . 0 ,   R G B ( 1 4 0 , 1 4 0 , 1 4 0 ) ) ; 
 
         / / g b . D r a w L i n e ( 1 6 + 8 - 2 ,   8 - 0 + 2 ,   1 6 + 8 + 2 ,   8 - 0 + 2 ,   1 . 0 ,   R G B ( 1 4 0 , 1 4 0 , 1 4 0 ) ) ; 
 
         / / g b . D r a w L i n e ( 1 6 + 8 - 1 ,   8 + 1 + 2 ,   1 6 + 8 + 1 ,   8 + 1 + 2 ,   1 . 0 ,   R G B ( 1 4 0 , 1 4 0 , 1 4 0 ) ) ; 
 
         / / g b . F i l l S o l i d R e c t ( 1 6 + 8 - 0 ,   8 + 2 + 2 ,   1 ,   1 ,   R G B ( 1 4 0 , 1 4 0 , 1 4 0 ) ) ; 
 
         b t _ s e t t i n g s _ o f f . R e l e a s e G r a p h i c s ( g b ) ; 
 
 
 
         b t _ s e t t i n g s _ o v   =   g d i . C r e a t e I m a g e ( 3 0 ,   3 0 ) ; 
 
         g b   =   b t _ s e t t i n g s _ o v . G e t G r a p h i c s ( ) ; 
 
         g u i _ f o n t   =   g d i . F o n t ( " S e g o e   M D L 2   A s s e t s " ,   2 0 ,   1 ) ; 
 
         g b . S e t T e x t R e n d e r i n g H i n t ( 3 ) ; 
 
         g b . D r a w S t r i n g ( " " ,   g u i _ f o n t ,   R G B ( 1 9 0 , 1 9 0 , 1 9 0 ) ,   0 ,   2 ,   2 0 ,   2 0 ,   l c _ s t r i n g f o r m a t ) ; 
 
         / / g b . S e t S m o o t h i n g M o d e ( 2 ) ; 
 
         / / g b . F i l l E l l i p s e ( 2 , 3 , 1 2 , 1 0 , R G B ( 1 8 0 , 1 8 0 , 1 8 0 ) ) ; 
 
         / / g b . D r a w E l l i p s e ( 5 , 5 , 6 , 6 , 2 . 0 , R G B A ( 0 , 0 , 0 , 2 2 0 ) ) ; 
 
         / / g b . D r a w E l l i p s e ( 2 , 3 , 1 2 , 1 0 , 1 . 0 , R G B A ( 0 , 0 , 0 , 1 4 0 ) ) ; 
 
         / / g b . S e t S m o o t h i n g M o d e ( 0 ) ; 
 
         / / g b . D r a w L i n e ( 1 6 + 8 - 4 ,   8 - 2 + 2 ,   1 6 + 8 + 4 ,   8 - 2 + 2 ,   1 . 0 ,   R G B ( 1 8 0 , 1 8 0 , 1 8 0 ) ) ; 
 
         / / g b . D r a w L i n e ( 1 6 + 8 - 3 ,   8 - 1 + 2 ,   1 6 + 8 + 3 ,   8 - 1 + 2 ,   1 . 0 ,   R G B ( 1 8 0 , 1 8 0 , 1 8 0 ) ) ; 
 
         / / g b . D r a w L i n e ( 1 6 + 8 - 2 ,   8 - 0 + 2 ,   1 6 + 8 + 2 ,   8 - 0 + 2 ,   1 . 0 ,   R G B ( 1 8 0 , 1 8 0 , 1 8 0 ) ) ; 
 
         / / g b . D r a w L i n e ( 1 6 + 8 - 1 ,   8 + 1 + 2 ,   1 6 + 8 + 1 ,   8 + 1 + 2 ,   1 . 0 ,   R G B ( 1 8 0 , 1 8 0 , 1 8 0 ) ) ; 
 
         / / g b . F i l l S o l i d R e c t ( 1 6 + 8 - 0 ,   8 + 2 + 2 ,   1 ,   1 ,   R G B ( 1 8 0 , 1 8 0 , 1 8 0 ) ) ; 
 
         b t _ s e t t i n g s _ o v . R e l e a s e G r a p h i c s ( g b ) ; 
 
         
 
         b t _ s e t t i n g s _ o n   =   g d i . C r e a t e I m a g e ( 3 0 ,   3 0 ) ; 
 
         g b   =   b t _ s e t t i n g s _ o n . G e t G r a p h i c s ( ) ; 
 
         g u i _ f o n t   =   g d i . F o n t ( " S e g o e   M D L 2   A s s e t s " ,   2 0 ,   1 ) ; 
 
         g b . S e t T e x t R e n d e r i n g H i n t ( 3 ) ; 
 
         g b . D r a w S t r i n g ( " " ,   g u i _ f o n t ,   R G B ( 2 3 0 , 2 3 0 , 2 3 0 ) ,   0 ,   2 ,   2 0 ,   2 0 ,   l c _ s t r i n g f o r m a t ) ; 
 
         / / g b . S e t S m o o t h i n g M o d e ( 2 ) ; 
 
         / / g b . F i l l E l l i p s e ( 2 , 3 , 1 2 , 1 0 , R G B ( 1 8 0 , 1 8 0 , 1 8 0 ) ) ; 
 
         / / g b . D r a w E l l i p s e ( 5 , 5 , 6 , 6 , 2 . 0 , R G B A ( 0 , 0 , 0 , 2 4 0 ) ) ; 
 
         / / g b . D r a w E l l i p s e ( 2 , 3 , 1 2 , 1 0 , 1 . 0 , R G B A ( 0 , 0 , 0 , 1 6 0 ) ) ; 
 
         / / g b . S e t S m o o t h i n g M o d e ( 0 ) ; 
 
         / / g b . D r a w L i n e ( 1 6 + 8 - 4 ,   8 - 2 + 2 ,   1 6 + 8 + 4 ,   8 - 2 + 2 ,   1 . 0 ,   R G B ( 2 2 0 , 2 2 0 , 2 2 0 ) ) ; 
 
         / / g b . D r a w L i n e ( 1 6 + 8 - 3 ,   8 - 1 + 2 ,   1 6 + 8 + 3 ,   8 - 1 + 2 ,   1 . 0 ,   R G B ( 2 2 0 , 2 2 0 , 2 2 0 ) ) ; 
 
         / / g b . D r a w L i n e ( 1 6 + 8 - 2 ,   8 - 0 + 2 ,   1 6 + 8 + 2 ,   8 - 0 + 2 ,   1 . 0 ,   R G B ( 2 2 0 , 2 2 0 , 2 2 0 ) ) ; 
 
         / / g b . D r a w L i n e ( 1 6 + 8 - 1 ,   8 + 1 + 2 ,   1 6 + 8 + 1 ,   8 + 1 + 2 ,   1 . 0 ,   R G B ( 2 2 0 , 2 2 0 , 2 2 0 ) ) ; 
 
         / / g b . F i l l S o l i d R e c t ( 1 6 + 8 - 0 ,   8 + 2 + 2 ,   1 ,   1 ,   R G B ( 2 2 0 , 2 2 0 , 2 2 0 ) ) ; 
 
         b t _ s e t t i n g s _ o n . R e l e a s e G r a p h i c s ( g b ) ; 
 
         
 
         / / = = = = = = = = = = = = = = = = = = = = = = =   b l u r   b t n 
 
         b t _ b l u r _ o f f   =   g d i . C r e a t e I m a g e ( 3 0 ,   3 0 ) ; 
 
         g b   =   b t _ b l u r _ o f f . G e t G r a p h i c s ( ) ; 
 
         g u i _ f o n t   =   g d i . F o n t ( " S e g o e   M D L 2   A s s e t s " ,   2 0 ,   0 ) ; 
 
         g b . S e t T e x t R e n d e r i n g H i n t ( 3 ) ; 
 
         g b . D r a w S t r i n g ( " " ,   g u i _ f o n t ,   R G B ( 1 5 0 , 1 5 0 , 1 5 0 ) ,   0 ,   2 ,   2 0 ,   2 0 ,   l c _ s t r i n g f o r m a t ) ; 
 
         b t _ b l u r _ o f f . R e l e a s e G r a p h i c s ( g b ) ; 
 
         
 
         b t _ b l u r _ o v   =   g d i . C r e a t e I m a g e ( 3 0 ,   3 0 ) ; 
 
         g b   =   b t _ b l u r _ o v . G e t G r a p h i c s ( ) ; 
 
         g u i _ f o n t   =   g d i . F o n t ( " S e g o e   M D L 2   A s s e t s " ,   2 0 ,   0 ) ; 
 
         g b . S e t T e x t R e n d e r i n g H i n t ( 3 ) ; 
 
         g b . D r a w S t r i n g ( " " ,   g u i _ f o n t ,   R G B ( 1 9 0 , 1 9 0 , 1 9 0 ) ,   0 ,   2 ,   2 0 ,   2 0 ,   l c _ s t r i n g f o r m a t ) ; 
 
         b t _ b l u r _ o v . R e l e a s e G r a p h i c s ( g b ) ; 
 
         
 
         b t _ b l u r _ o n   =   g d i . C r e a t e I m a g e ( 3 0 ,   3 0 ) ; 
 
         g b   =   b t _ b l u r _ o n . G e t G r a p h i c s ( ) ; 
 
         g u i _ f o n t   =   g d i . F o n t ( " S e g o e   M D L 2   A s s e t s " ,   2 0 ,   0 ) ; 
 
         g b . S e t T e x t R e n d e r i n g H i n t ( 3 ) ; 
 
         g b . D r a w S t r i n g ( " " ,   g u i _ f o n t ,   R G B ( 2 3 0 , 2 3 0 , 2 3 0 ) ,   0 ,   2 ,   2 0 ,   2 0 ,   l c _ s t r i n g f o r m a t ) ; 
 
         b t _ b l u r _ o n . R e l e a s e G r a p h i c s ( g b ) ; 
 
         
 
         / / = = = = = = = = = = = = = = = = = = = = = = =   w a l l p a p e r   o n \ o f f 
 
         b t _ w a l l _ o f f   =   g d i . C r e a t e I m a g e ( 3 0 ,   3 0 ) ; 
 
         g b   =   b t _ w a l l _ o f f . G e t G r a p h i c s ( ) ; 
 
         g u i _ f o n t   =   g d i . F o n t ( " S e g o e   M D L 2   A s s e t s " ,   2 0 ,   0 ) ; 
 
         g b . S e t T e x t R e n d e r i n g H i n t ( 3 ) ; 
 
         g b . D r a w S t r i n g ( " " ,   g u i _ f o n t ,   R G B ( 1 5 0 , 1 5 0 , 1 5 0 ) ,   0 ,   2 ,   2 0 ,   2 0 ,   l c _ s t r i n g f o r m a t ) ; 
 
         b t _ w a l l _ o f f . R e l e a s e G r a p h i c s ( g b ) ; 
 
         
 
         b t _ w a l l _ o v   =   g d i . C r e a t e I m a g e ( 3 0 ,   3 0 ) ; 
 
         g b   =   b t _ w a l l _ o v . G e t G r a p h i c s ( ) ; 
 
         g u i _ f o n t   =   g d i . F o n t ( " S e g o e   M D L 2   A s s e t s " ,   2 0 ,   0 ) ; 
 
         g b . S e t T e x t R e n d e r i n g H i n t ( 3 ) ; 
 
         g b . D r a w S t r i n g ( " " ,   g u i _ f o n t ,   R G B ( 1 9 0 , 1 9 0 , 1 9 0 ) ,   0 ,   2 ,   2 0 ,   2 0 ,   l c _ s t r i n g f o r m a t ) ; 
 
         b t _ w a l l _ o v . R e l e a s e G r a p h i c s ( g b ) ; 
 
         
 
         b t _ w a l l _ o n   =   g d i . C r e a t e I m a g e ( 3 0 ,   3 0 ) ; 
 
         g b   =   b t _ w a l l _ o n . G e t G r a p h i c s ( ) ; 
 
         g u i _ f o n t   =   g d i . F o n t ( " S e g o e   M D L 2   A s s e t s " ,   2 0 ,   0 ) ; 
 
         g b . S e t T e x t R e n d e r i n g H i n t ( 3 ) ; 
 
         g b . D r a w S t r i n g ( " " ,   g u i _ f o n t ,   R G B ( 2 3 0 , 2 3 0 , 2 3 0 ) ,   0 ,   2 ,   2 0 ,   2 0 ,   l c _ s t r i n g f o r m a t ) ; 
 
         b t _ w a l l _ o n . R e l e a s e G r a p h i c s ( g b ) ; 
 
                 
 
         / / = = = = = = = = = = = = = = = = = = = = = = =   
 
 
 
         / /   S o r t / g r o u p   M e n u   b u t t o n 
 
         b t _ s o r t _ o f f   =   g d i . C r e a t e I m a g e ( 3 0 ,   3 0 ) ; 
 
         g b   =   b t _ s o r t _ o f f . G e t G r a p h i c s ( ) ; 
 
         g u i _ f o n t   =   g d i . F o n t ( " T a h o m a " ,   1 9 ,   0 ) ; 
 
         g b . S e t T e x t R e n d e r i n g H i n t ( 5 ) ; 
 
         g b . D r a w S t r i n g ( " A z " ,   g u i _ f o n t ,   R G B ( 1 4 0 , 1 4 0 , 1 4 0 ) ,   0 ,   - 2 ,   2 0 ,   2 0 ,   l c _ s t r i n g f o r m a t ) ; 
 
         g b . S e t S m o o t h i n g M o d e ( 0 ) ; 
 
         g b . D r a w L i n e ( 1 6 + 8 - 4 ,   8 - 2 + 2 ,   1 6 + 8 + 4 ,   8 - 2 + 2 ,   1 . 0 ,   R G B ( 1 4 0 , 1 4 0 , 1 4 0 ) ) ; 
 
         g b . D r a w L i n e ( 1 6 + 8 - 3 ,   8 - 1 + 2 ,   1 6 + 8 + 3 ,   8 - 1 + 2 ,   1 . 0 ,   R G B ( 1 4 0 , 1 4 0 , 1 4 0 ) ) ; 
 
         g b . D r a w L i n e ( 1 6 + 8 - 2 ,   8 - 0 + 2 ,   1 6 + 8 + 2 ,   8 - 0 + 2 ,   1 . 0 ,   R G B ( 1 4 0 , 1 4 0 , 1 4 0 ) ) ; 
 
         g b . D r a w L i n e ( 1 6 + 8 - 1 ,   8 + 1 + 2 ,   1 6 + 8 + 1 ,   8 + 1 + 2 ,   1 . 0 ,   R G B ( 1 4 0 , 1 4 0 , 1 4 0 ) ) ; 
 
         g b . F i l l S o l i d R e c t ( 1 6 + 8 - 0 ,   8 + 2 + 2 ,   1 ,   1 ,   R G B ( 1 4 0 , 1 4 0 , 1 4 0 ) ) ; 
 
         b t _ s o r t _ o f f . R e l e a s e G r a p h i c s ( g b ) ; 
 
 
 
         b t _ s o r t _ o v   =   g d i . C r e a t e I m a g e ( 3 0 ,   3 0 ) ; 
 
         g b   =   b t _ s o r t _ o v . G e t G r a p h i c s ( ) ; 
 
         g u i _ f o n t   =   g d i . F o n t ( " T a h o m a " ,   1 9 ,   0 ) ; 
 
         g b . S e t T e x t R e n d e r i n g H i n t ( 5 ) ; 
 
         g b . D r a w S t r i n g ( " A z " ,   g u i _ f o n t ,   R G B ( 1 8 0 , 1 8 0 , 1 8 0 ) ,   0 ,   - 2 ,   2 0 ,   2 0 ,   l c _ s t r i n g f o r m a t ) ; 
 
         g b . S e t S m o o t h i n g M o d e ( 0 ) ; 
 
         g b . D r a w L i n e ( 1 6 + 8 - 4 ,   8 - 2 + 2 ,   1 6 + 8 + 4 ,   8 - 2 + 2 ,   1 . 0 ,   R G B ( 1 8 0 , 1 8 0 , 1 8 0 ) ) ; 
 
         g b . D r a w L i n e ( 1 6 + 8 - 3 ,   8 - 1 + 2 ,   1 6 + 8 + 3 ,   8 - 1 + 2 ,   1 . 0 ,   R G B ( 1 8 0 , 1 8 0 , 1 8 0 ) ) ; 
 
         g b . D r a w L i n e ( 1 6 + 8 - 2 ,   8 - 0 + 2 ,   1 6 + 8 + 2 ,   8 - 0 + 2 ,   1 . 0 ,   R G B ( 1 8 0 , 1 8 0 , 1 8 0 ) ) ; 
 
         g b . D r a w L i n e ( 1 6 + 8 - 1 ,   8 + 1 + 2 ,   1 6 + 8 + 1 ,   8 + 1 + 2 ,   1 . 0 ,   R G B ( 1 8 0 , 1 8 0 , 1 8 0 ) ) ; 
 
         g b . F i l l S o l i d R e c t ( 1 6 + 8 - 0 ,   8 + 2 + 2 ,   1 ,   1 ,   R G B ( 1 8 0 , 1 8 0 , 1 8 0 ) ) ; 
 
         b t _ s o r t _ o v . R e l e a s e G r a p h i c s ( g b ) ; 
 
         
 
         b t _ s o r t _ o n   =   g d i . C r e a t e I m a g e ( 3 0 ,   3 0 ) ; 
 
         g b   =   b t _ s o r t _ o n . G e t G r a p h i c s ( ) ; 
 
         g u i _ f o n t   =   g d i . F o n t ( " T a h o m a " ,   1 9 ,   0 ) ; 
 
         g b . S e t T e x t R e n d e r i n g H i n t ( 5 ) ; 
 
         g b . D r a w S t r i n g ( " A z " ,   g u i _ f o n t ,   R G B ( 2 2 0 , 2 2 0 , 2 2 0 ) ,   0 ,   - 2 ,   2 0 ,   2 0 ,   l c _ s t r i n g f o r m a t ) ; 
 
         g b . S e t S m o o t h i n g M o d e ( 0 ) ; 
 
         g b . D r a w L i n e ( 1 6 + 8 - 4 ,   8 - 2 + 2 ,   1 6 + 8 + 4 ,   8 - 2 + 2 ,   1 . 0 ,   R G B ( 2 2 0 , 2 2 0 , 2 2 0 ) ) ; 
 
         g b . D r a w L i n e ( 1 6 + 8 - 3 ,   8 - 1 + 2 ,   1 6 + 8 + 3 ,   8 - 1 + 2 ,   1 . 0 ,   R G B ( 2 2 0 , 2 2 0 , 2 2 0 ) ) ; 
 
         g b . D r a w L i n e ( 1 6 + 8 - 2 ,   8 - 0 + 2 ,   1 6 + 8 + 2 ,   8 - 0 + 2 ,   1 . 0 ,   R G B ( 2 2 0 , 2 2 0 , 2 2 0 ) ) ; 
 
         g b . D r a w L i n e ( 1 6 + 8 - 1 ,   8 + 1 + 2 ,   1 6 + 8 + 1 ,   8 + 1 + 2 ,   1 . 0 ,   R G B ( 2 2 0 , 2 2 0 , 2 2 0 ) ) ; 
 
         g b . F i l l S o l i d R e c t ( 1 6 + 8 - 0 ,   8 + 2 + 2 ,   1 ,   1 ,   R G B ( 2 2 0 , 2 2 0 , 2 2 0 ) ) ; 
 
         b t _ s o r t _ o n . R e l e a s e G r a p h i c s ( g b ) ; 
 
 
 
         t o o l b a r . b u t t o n s . s p l i c e ( 0 ,   t o o l b a r . b u t t o n s . l e n g t h ) ; 
 
         f o r ( i = 0 ; i < 4 ; i + + )   { 
 
                 s w i t c h ( i )   { 
 
                   c a s e   0 : 
 
                         t o o l b a r . b u t t o n s . p u s h ( n e w   b u t t o n ( b t _ s e t t i n g s _ o f f ,   b t _ s e t t i n g s _ o v ,   b t _ s e t t i n g s _ o n ) ) ; 
 
                         b r e a k ; 
 
                   c a s e   1 : 
 
                         t o o l b a r . b u t t o n s . p u s h ( n e w   b u t t o n ( b t _ s o r t _ o f f ,   b t _ s o r t _ o v ,   b t _ s o r t _ o n ) ) ; 
 
                         b r e a k ; 
 
                   c a s e   2 : 
 
                         t o o l b a r . b u t t o n s . p u s h ( n e w   b u t t o n ( b t _ b l u r _ o f f ,   b t _ b l u r _ o v ,   b t _ b l u r _ o n ) ) ; 
 
                         b r e a k ; 
 
                   c a s e   3 : 
 
                         t o o l b a r . b u t t o n s . p u s h ( n e w   b u t t o n ( b t _ w a l l _ o f f ,   b t _ w a l l _ o v ,   b t _ w a l l _ o n ) ) ; 
 
                         b r e a k ; 
 
                 } ; 
 
         } ; 
 
 } ; 
 
 
 
 f u n c t i o n   r e c a l c _ d a t a s ( )   { 
 
         
 
         i f ( t o o l b a r . l o c k )   { 
 
                 t o o l b a r . d e l t a   =   t o o l b a r . c o l l a p s e d _ y * - 1 ; 
 
                 t o o l b a r . s t a t e   =   t r u e ; 
 
         } ; 
 
               
 
         i f ( p a n e l . n o g r o u p h e a d e r )   { 
 
                 g r o u p . n b r o w s   =   0 ; 
 
         }   e l s e   { 
 
                 g r o u p . n b r o w s   =   g r o u p . n b r o w s _ d e f a u l t ; 
 
         } ; 
 
         
 
         l i s t . n b v i s   =   ( ( ( w h - t o o l b a r . h ) / r o w . h )   = =   M a t h . c e i l ( ( w h - t o o l b a r . h ) / r o w . h ) )   ?   M a t h . c e i l ( ( w h - t o o l b a r . h ) / r o w . h )   :   M a t h . c e i l ( ( ( w h - t o o l b a r . h ) / r o w . h ) - 1 ) ; 
 
         
 
         i f ( p a n e l . t h e m e d )   { 
 
                 v s c r o l l b a r . t h e m e   =   w i n d o w . C r e a t e T h e m e M a n a g e r ( " s c r o l l b a r " ) ; 
 
                 l i s t . t h e m e   =   w i n d o w . C r e a t e T h e m e M a n a g e r ( " l i s t v i e w " ) ; 
 
         }   e l s e   { 
 
                 v s c r o l l b a r . t h e m e   =   f a l s e ; 
 
                 l i s t . t h e m e   =   f a l s e ; 
 
         } ; 
 
         i n i t _ v s c r o l l b a r _ b u t t o n s ( ) ; 
 
     
 
         b u t t o n _ u p . y   =   0 ; 
 
         b u t t o n _ d o w n . y   =   w h   -   b u t t o n _ d o w n . h ; 
 
         v s c r o l l b a r . y   =   b u t t o n _ u p . h ; 
 
         v s c r o l l b a r . h   =   w h   -   b u t t o n _ u p . h   -   b u t t o n _ d o w n . h ; 
 
         c u r s o r . x   =   w w - v s c r o l l b a r . w ; 
 
         c u r s o r . y   =   v s c r o l l b a r . y ; 
 
         
 
         i f ( c o v e r . s h o w )   { 
 
                 c o v e r . w   =   g r o u p . n b r o w s * r o w . h ; 
 
         }   e l s e   { 
 
                 c o v e r . w   =   0 ; 
 
         } ; 
 
         i f ( c o v e r . w > r o w . h )   { 
 
                 c o v e r . v i s i b l e   =   t r u e ; 
 
                 c o v e r . h   =   c o v e r . w ; 
 
                 c o v e r . n b r o w s   =   M a t h . c e i l ( c o v e r . w / r o w . h ) ; 
 
         }   e l s e   { 
 
                 c o v e r . v i s i b l e   =   f a l s e ; 
 
                 c o v e r . h   =   c o v e r . w ; 
 
                 c o v e r . n b r o w s   =   M a t h . c e i l ( c o v e r . w / r o w . h ) ; 
 
         } ; 
 
 } ; 
 
 
 
 f u n c t i o n   r e d r a w _ s t u b _ i m a g e s ( )   { 
 
         n o c o v e r _ i m g   =   F o r m a t C o v e r ( n o c o v e r ,   ( c o v e r . w - c o v e r . m a r g i n * 2 ) ,   ( c o v e r . h - c o v e r . m a r g i n * 2 ) ) ; 
 
         n o a r t i s t _ i m g   =   F o r m a t C o v e r ( n o a r t i s t ,   ( c o v e r . w - c o v e r . m a r g i n * 2 ) ,   ( c o v e r . h - c o v e r . m a r g i n * 2 ) ) ; 
 
         s t r e a m c o v e r _ i m g   =   F o r m a t C o v e r ( s t r e a m c o v e r ,   ( c o v e r . w - c o v e r . m a r g i n * 2 ) ,   ( c o v e r . h - c o v e r . m a r g i n * 2 ) ) ; 
 
 } ; 
 
 
 
 f u n c t i o n   S e l e c t G r o u p I t e m s ( s t a r t _ i d )   { 
 
         v a r   c o u n t   =   0 ; 
 
         v a r   a f f e c t e d I t e m s   =   A r r a y ( ) ; 
 
         
 
         i f ( ! u t i l s . I s K e y P r e s s e d ( V K _ C O N T R O L ) )   { 
 
                 p l m a n . C l e a r P l a y l i s t S e l e c t i o n ( p l m a n . A c t i v e P l a y l i s t ) ; 
 
         } ; 
 
 
 
         f o r ( v a r   i   =   s t a r t _ i d ;   i   <   l i s t . t o t a l ;   i + + )   { 
 
                 i f ( l i s t . h l i s t [ i ]   ! =   l i s t . h l i s t [ s t a r t _ i d ] )   { 
 
                         b r e a k ; 
 
                 }   e l s e   { 
 
                         a f f e c t e d I t e m s . p u s h ( i ) ; 
 
                 } ; 
 
                 c o u n t + + ; 
 
                 i f ( c o u n t > 9 9 9 9 )   b r e a k ; 
 
         } ; 
 
         p l m a n . S e t P l a y l i s t S e l e c t i o n ( p l m a n . A c t i v e P l a y l i s t ,   a f f e c t e d I t e m s ,   t r u e ) ; 
 
         p l m a n . S e t P l a y l i s t F o c u s I t e m ( p l m a n . A c t i v e P l a y l i s t ,   s t a r t _ i d ) ; 
 
         C o l l e c t G a r b a g e ( ) ; 
 
 } ; 
 
 
 
 f u n c t i o n   S e l e c t A t o B ( s t a r t _ i d ,   e n d _ i d )   { 
 
 
 
         v a r   a f f e c t e d I t e m s   =   A r r a y ( ) ; 
 
         
 
         i f ( l i s t . S H I F T _ s t a r t _ i d = = n u l l )   { 
 
                 l i s t . S H I F T _ s t a r t _ i d   =   s t a r t _ i d ; 
 
         } ; 
 
         
 
         p l m a n . C l e a r P l a y l i s t S e l e c t i o n ( p l m a n . A c t i v e P l a y l i s t ) ; 
 
         
 
         v a r   p r e v i o u s _ f o c u s _ i d   =   l i s t . f o c u s _ i d ; 
 
         
 
         i f ( s t a r t _ i d < e n d _ i d )   { 
 
                 v a r   d e b   =   s t a r t _ i d ; 
 
                 v a r   f i n   =   e n d _ i d ; 
 
         }   e l s e   { 
 
                 v a r   d e b   =   e n d _ i d ; 
 
                 v a r   f i n   =   s t a r t _ i d ;                 
 
         } ; 
 
 
 
         f o r ( v a r   i = d e b ; i < = f i n ; i + + )   { 
 
                 a f f e c t e d I t e m s . p u s h ( i ) ; 
 
         } ; 
 
         p l m a n . S e t P l a y l i s t S e l e c t i o n ( p l m a n . A c t i v e P l a y l i s t ,   a f f e c t e d I t e m s ,   t r u e ) ; 
 
         
 
         p l m a n . S e t P l a y l i s t F o c u s I t e m ( p l m a n . A c t i v e P l a y l i s t ,   e n d _ i d ) ; 
 
         
 
         i f ( a f f e c t e d I t e m s . l e n g t h > 1 )   { 
 
                 i f ( e n d _ i d   >   p r e v i o u s _ f o c u s _ i d )   { 
 
                         v a r   d e l t a   =   e n d _ i d   -   p r e v i o u s _ f o c u s _ i d ; 
 
                         l i s t . S H I F T _ c o u n t   + =   d e l t a ; 
 
                 }   e l s e   { 
 
                         v a r   d e l t a   =   p r e v i o u s _ f o c u s _ i d   -   e n d _ i d ; 
 
                         l i s t . S H I F T _ c o u n t   - =   d e l t a ; 
 
                 } ; 
 
         } ; 
 
         
 
         w i n d o w . R e p a i n t ( ) ; 
 
 } ; 
 
 
 
 f u n c t i o n   S h o w N o w P l a y i n g ( )   { 
 
         i f ( f b . I s P l a y i n g )   { 
 
                 i f ( p l m a n . P l a y i n g P l a y l i s t ! = p l m a n . A c t i v e P l a y l i s t )   { 
 
                         p l m a n . A c t i v e P l a y l i s t   =   p l m a n . P l a y i n g P l a y l i s t ; 
 
                 } ; 
 
                 i f ( p l m a n . P l a y l i s t I t e m C o u n t ( p l m a n . P l a y i n g P l a y l i s t ) = = 0   | |   ! f b . G e t F o c u s I t e m ( f a l s e ) )   r e t u r n   t r u e ; 
 
                 p l m a n . C l e a r P l a y l i s t S e l e c t i o n ( p l m a n . A c t i v e P l a y l i s t ) ; 
 
                 l i s t . n o w p l a y i n g   =   p l m a n . G e t P l a y i n g I t e m L o c a t i o n ( ) ; 
 
                 v a r   p i d   =   l i s t . n o w p l a y i n g . P l a y l i s t I t e m I n d e x ; 
 
                 p l m a n . S e t P l a y l i s t F o c u s I t e m ( p l m a n . A c t i v e P l a y l i s t ,   p i d ) ; 
 
                 p l m a n . S e t P l a y l i s t S e l e c t i o n S i n g l e ( p l m a n . A c t i v e P l a y l i s t ,   p i d ,   t r u e ) ; 
 
                 i f ( p i d > = 0   & &   p i d < l i s t . t o t a l )   { 
 
                         r e f r e s h _ s p v ( p l m a n . A c t i v e P l a y l i s t ,   f a l s e ) ; 
 
                 } ; 
 
         }   e l s e   { 
 
                 p l m a n . C l e a r P l a y l i s t S e l e c t i o n ( p l m a n . A c t i v e P l a y l i s t ) ; 
 
                 v a r   p i d   =   p l m a n . G e t P l a y l i s t F o c u s I t e m I n d e x ( p l m a n . A c t i v e P l a y l i s t ) ; 
 
                 p l m a n . S e t P l a y l i s t F o c u s I t e m ( p l m a n . A c t i v e P l a y l i s t ,   p i d ) ; 
 
                 p l m a n . S e t P l a y l i s t S e l e c t i o n S i n g l e ( p l m a n . A c t i v e P l a y l i s t ,   p i d ,   t r u e ) ; 
 
                 i f ( p i d > = 0   & &   p i d < l i s t . t o t a l )   { 
 
                         r e f r e s h _ s p v ( p l m a n . A c t i v e P l a y l i s t ,   f a l s e ) ; 
 
                 } ; 
 
         } ; 
 
 } ; 
 
 
 
 f u n c t i o n   S h o w S e l e c t e d I t e m ( p i d )   { 
 
         i f ( l i s t . t o t a l = = 0   | |   ! f b . G e t F o c u s I t e m ( f a l s e ) )   r e t u r n   t r u e ; 
 
         i f ( p i d < 0 )   { 
 
                 p i d   =   p l m a n . G e t P l a y l i s t F o c u s I t e m I n d e x ( p l m a n . A c t i v e P l a y l i s t ) ; 
 
         } ; 
 
         p l m a n . C l e a r P l a y l i s t S e l e c t i o n ( p l m a n . A c t i v e P l a y l i s t ) ; 
 
         p l m a n . S e t P l a y l i s t F o c u s I t e m ( p l m a n . A c t i v e P l a y l i s t ,   p i d ) ; 
 
         p l m a n . S e t P l a y l i s t S e l e c t i o n S i n g l e ( p l m a n . A c t i v e P l a y l i s t ,   p i d ,   t r u e ) ; 
 
         r e f r e s h _ s p v ( p l m a n . A c t i v e P l a y l i s t ) ; 
 
 } ; 
 
 
 
 f u n c t i o n   I n c r e m e n t a l S e a r c h ( )   { 
 
         v a r   c o u n t = 0 ; 
 
         v a r   a l b u m a r t i s t ; 
 
         v a r   c h r ; 
 
         v a r   g s t a r t ; 
 
         v a r   p i d   =   - 1 ; 
 
         
 
         / /   e x i t   i f   n o   s e a r c h   s t r i n g   i n   c a c h e 
 
         i f ( g _ s e a r c h _ s t r i n g . l e n g t h < = 0 )   r e t u r n   t r u e ; 
 
         
 
         / /   1 s t   c h a r   o f   t h e   s e a r c h   s t r i n g 
 
         v a r   f i r s t _ c h r   =   g _ s e a r c h _ s t r i n g . s u b s t r i n g ( 0 , 1 ) ;     
 
         v a r   l e n   =   g _ s e a r c h _ s t r i n g . l e n g t h ; 
 
         
 
         / /   w h i c h   s t a r t   p o i n t   f o r   t h e   s e a r c h 
 
         i f ( l i s t . t o t a l > 1 0 0 0 )   { 
 
                 a l b u m a r t i s t   =   t f _ a l b u m a r t i s t . E v a l W i t h M e t a d b ( l i s t . h a n d l e l i s t . I t e m ( M a t h . f l o o r ( l i s t . t o t a l / 2 ) ) ) ; 
 
                 c h r   =   a l b u m a r t i s t . s u b s t r i n g ( 0 , 1 ) ; 
 
                 i f ( f i r s t _ c h r . c h a r C o d e A t ( f i r s t _ c h r )   >   c h r . c h a r C o d e A t ( c h r ) )   { 
 
                         g s t a r t   =   M a t h . f l o o r ( l i s t . t o t a l / 2 ) ; 
 
                 }   e l s e   { 
 
                         g s t a r t   =   0 ; 
 
                 } ; 
 
         }   e l s e   { 
 
                 g s t a r t   =   0 ; 
 
         } ; 
 
 
 
         v a r   f o r m a t _ s t r   =   " " ; 
 
         f o r ( v a r   i = g s t a r t ; i < l i s t . t o t a l ; i + + )   { 
 
                 a l b u m a r t i s t   =   t f _ a l b u m a r t i s t . E v a l W i t h M e t a d b ( l i s t . h a n d l e l i s t . I t e m ( i ) ) ; 
 
                 f o r m a t _ s t r   =   a l b u m a r t i s t . s u b s t r i n g ( 0 , l e n ) . t o U p p e r C a s e ( ) ; 
 
                 i f ( f o r m a t _ s t r = = g _ s e a r c h _ s t r i n g )   { 
 
                         p i d   =   i ; 
 
                         b r e a k ; 
 
                 } ; 
 
         } ; 
 
         
 
         i f ( p i d > = 0 )   {   / /   f o u n d ! 
 
                 S h o w S e l e c t e d I t e m ( p i d ) ; 
 
         }   e l s e   { 
 
                 l i s t . i n c _ s e a r c h _ n o r e s u l t   =   t r u e ; 
 
                 w i n d o w . R e p a i n t ( ) ; 
 
         } ; 
 
         
 
         c l e a r _ i n c s e a r c h _ t i m e r   & &   w i n d o w . C l e a r I n t e r v a l ( c l e a r _ i n c s e a r c h _ t i m e r ) ; 
 
         c l e a r _ i n c s e a r c h _ t i m e r   =   w i n d o w . S e t I n t e r v a l ( f u n c t i o n   ( )   { 
 
                 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =   I N C _ S E A R C H _ T i m e r = = =   r e s e t   i n c r e m e n t a l   s e a r c h   s t r i n g   a f t e r   1   s e c o n d s   w i t h o u t   a n y   k e y   p r e s s e d 
 
                 v a r   t t _ x   =   ( ( w w - v s c r o l l b a r . w )   /   2 )   -   ( ( ( g _ s e a r c h _ s t r i n g . l e n g t h * 1 3 ) + ( 1 0 * 2 ) )   /   2 ) ; 
 
                 v a r   t t _ y   =   ( w h / 2 )   -   3 0 ; 
 
                 v a r   t t _ w   =   ( ( g _ s e a r c h _ s t r i n g . l e n g t h * 1 3 ) + ( 1 0 * 2 ) ) ; 
 
                 v a r   t t _ h   =   8 0 ; 
 
                 g _ s e a r c h _ s t r i n g   =   " " ; 
 
                 w i n d o w . R e p a i n t R e c t ( 0 ,   t t _ y - 2 ,   w w - v s c r o l l b a r . w ,   t t _ h + 4 ) ; 
 
                 c l e a r _ i n c s e a r c h _ t i m e r   & &   w i n d o w . C l e a r I n t e r v a l ( c l e a r _ i n c s e a r c h _ t i m e r ) ; 
 
                 c l e a r _ i n c s e a r c h _ t i m e r   =   f a l s e ; 
 
                 l i s t . i n c _ s e a r c h _ n o r e s u l t   =   f a l s e ; 
 
         } ,   p p t . q _ s e a r c h _ t i m e r ) ; 
 
 } ; 
 
 
 
 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = / /   I t e m   C o n t e x t   M e n u 
 
 f u n c t i o n   n e w _ c o n t e x t _ m e n u ( x ,   y ,   i d ,   a r r a y _ i d )   { 
 
                           
 
         v a r   _ m e n u   =   w i n d o w . C r e a t e P o p u p M e n u ( ) ; 
 
         v a r   C o n t e x t   =   f b . C r e a t e C o n t e x t M e n u M a n a g e r ( ) ; 
 
         
 
         v a r   _ c h i l d 0 1   =   w i n d o w . C r e a t e P o p u p M e n u ( ) ; 
 
         v a r   _ c h i l d 0 2   =   w i n d o w . C r e a t e P o p u p M e n u ( ) ; 
 
         
 
         l i s t . m e t a d b l i s t _ s e l e c t i o n   =   p l m a n . G e t P l a y l i s t S e l e c t e d I t e m s ( p l m a n . A c t i v e P l a y l i s t ) ; 
 
         C o n t e x t . I n i t C o n t e x t ( l i s t . m e t a d b l i s t _ s e l e c t i o n ) ; 
 
         C o n t e x t . B u i l d M e n u ( _ m e n u ,   1 ,   - 1 ) ; 
 
       
 
         _ c h i l d 0 1 . A p p e n d T o ( _ m e n u ,   M F _ S T R I N G ,   " S e l e c t i o n . . . " ) ; 
 
         _ c h i l d 0 1 . A p p e n d M e n u I t e m ( ( f b . I s A u t o P l a y l i s t ( p l m a n . A c t i v e P l a y l i s t )   | |   i s Q u e u e P l a y l i s t A c t i v e ( ) ) ? M F _ D I S A B L E D | M F _ G R A Y E D : M F _ S T R I N G ,   1 0 0 0 ,   " R e m o v e " ) ; 
 
         _ c h i l d 0 2 . A p p e n d T o ( _ c h i l d 0 1 ,   M F _ S T R I N G ,   " S e n d   t o . . . " ) ; 
 
         _ c h i l d 0 2 . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   2 0 0 0 ,   " a   N e w   p l a y l i s t . . . " ) ; 
 
                 _ c h i l d 0 2 . A p p e n d M e n u I t e m ( M F _ S E P A R A T O R ,   0 ,   " " ) ; 
 
         v a r   p l _ c o u n t   =   p l m a n . P l a y l i s t C o u n t ; 
 
         f o r ( v a r   i = 0 ; i < p l _ c o u n t ; i + + )   { 
 
                 i f ( i ! = p l m a n . A c t i v e P l a y l i s t   & &   ! f b . I s A u t o P l a y l i s t ( i ) )   { 
 
                         _ c h i l d 0 2 . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   2 0 0 1 + i ,   p l m a n . G e t P l a y l i s t N a m e ( i ) ) ; 
 
                 } ; 
 
         } ; 
 
 
 
         v a r   r e t   =   _ m e n u . T r a c k P o p u p M e n u ( x ,   y ) ; 
 
         i f ( r e t < 8 0 0 )   { 
 
                 C o n t e x t . E x e c u t e B y I D ( r e t   -   1 ) ; 
 
         }   e l s e   i f ( r e t < 1 0 0 0 )   { 
 
                 s w i t c h   ( r e t )   { 
 
                 c a s e   8 8 0 : 
 
                 
 
                         b r e a k ; 
 
                 } ; 
 
         }   e l s e   { 
 
                 s w i t c h   ( r e t )   { 
 
                 c a s e   1 0 0 0 : 
 
                         p l m a n . R e m o v e P l a y l i s t S e l e c t i o n ( p l m a n . A c t i v e P l a y l i s t ,   f a l s e ) ; 
 
                         b r e a k ; 
 
                 c a s e   2 0 0 0 : 
 
                         f b . R u n M a i n M e n u C o m m a n d ( " F i l e / N e w   p l a y l i s t " ) ; 
 
                         p l m a n . I n s e r t P l a y l i s t I t e m s ( p l m a n . P l a y l i s t C o u n t - 1 ,   0 ,   l i s t . m e t a d b l i s t _ s e l e c t i o n ,   f a l s e ) ; 
 
                         b r e a k ; 
 
                 d e f a u l t : 
 
                         v a r   i n s e r t _ i n d e x   =   p l m a n . P l a y l i s t I t e m C o u n t ( r e t - 2 0 0 1 ) ; 
 
                         p l m a n . I n s e r t P l a y l i s t I t e m s ( ( r e t - 2 0 0 1 ) ,   i n s e r t _ i n d e x ,   l i s t . m e t a d b l i s t _ s e l e c t i o n ,   f a l s e ) ; 
 
                 } ; 
 
         } ; 
 
         _ c h i l d 0 1 . D i s p o s e ( ) ; 
 
         _ c h i l d 0 2 . D i s p o s e ( ) ; 
 
         _ m e n u . D i s p o s e ( ) ; 
 
         r e t u r n   t r u e ; 
 
 } ; 
 
 
 
 f u n c t i o n   s o r t _ g r o u p _ m e n u ( x ,   y )   { 
 
         v a r   i d x ; 
 
         v a r   _ m e n u   =   w i n d o w . C r e a t e P o p u p M e n u ( ) ; 
 
         v a r   _ s o r t   =   w i n d o w . C r e a t e P o p u p M e n u ( ) ; 
 
         v a r   _ g r o u p b y   =   w i n d o w . C r e a t e P o p u p M e n u ( ) ; 
 
       
 
         _ s o r t . A p p e n d T o ( _ m e n u ,   M F _ S T R I N G ,   " S o r t " ) ; 
 
         _ s o r t . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   1 0 0 ,   " S o r t   b y   a l b u m " ) ; 
 
         _ s o r t . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   1 1 0 ,   " S o r t   b y   a r t i s t " ) ; 
 
         _ s o r t . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   1 2 0 ,   " S o r t   b y   f i l e   p a t h " ) ; 
 
         _ s o r t . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   1 3 0 ,   " S o r t   b y   d a t e " ) ; 
 
         _ s o r t . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   1 4 0 ,   " S o r t   b y   g e n r e " ) ; 
 
         _ s o r t . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   1 5 0 ,   " R a n d o m i z e " ) ; 
 
         _ s o r t . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   1 6 0 ,   " R e v e r s e " ) ; 
 
         _ g r o u p b y . A p p e n d T o ( _ m e n u ,   M F _ S T R I N G ,   " G r o u p / S o r t " ) ; 
 
         _ g r o u p b y . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   2 0 0 ,   " G r o u p / S o r t   b y   a l b u m " ) ; 
 
         _ g r o u p b y . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   2 0 1 ,   " G r o u p / S o r t   b y   a r t i s t " ) ; 
 
         _ g r o u p b y . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   2 0 2 ,   " G r o u p / S o r t   b y   f i l e   p a t h " ) ; 
 
         i d x   =   _ m e n u . T r a c k P o p u p M e n u ( x ,   y ) ; 
 
         s w i t c h ( i d x )   { 
 
                 c a s e   1 0 0 : 
 
                         p l m a n . S o r t B y F o r m a t ( p l m a n . A c t i v e P l a y l i s t ,   s o r t _ p a t t e r n _ a l b u m ,   f a l s e ) ; 
 
                         b r e a k ; 
 
                 c a s e   1 1 0 : 
 
                         p l m a n . S o r t B y F o r m a t ( p l m a n . A c t i v e P l a y l i s t ,   s o r t _ p a t t e r n _ a r t i s t ,   f a l s e ) ; 
 
                         b r e a k ; 
 
                 c a s e   1 2 0 : 
 
                         p l m a n . S o r t B y F o r m a t ( p l m a n . A c t i v e P l a y l i s t ,   s o r t _ p a t t e r n _ p a t h ,   f a l s e ) ; 
 
                         b r e a k ; 
 
                 c a s e   1 3 0 : 
 
                         p l m a n . S o r t B y F o r m a t ( p l m a n . A c t i v e P l a y l i s t ,   s o r t _ p a t t e r n _ d a t e ,   f a l s e ) ; 
 
                         b r e a k ; 
 
                 c a s e   1 4 0 : 
 
                         p l m a n . S o r t B y F o r m a t ( p l m a n . A c t i v e P l a y l i s t ,   s o r t _ p a t t e r n _ g e n r e ,   f a l s e ) ; 
 
                         b r e a k ; 
 
                 c a s e   1 5 0 : 
 
                         p l m a n . S o r t B y F o r m a t ( p l m a n . A c t i v e P l a y l i s t ,   " " ,   f a l s e ) ; 
 
                         b r e a k ; 
 
                 c a s e   1 6 0 : 
 
                         f b . R u n M a i n M e n u C o m m a n d ( " E d i t / S o r t / R e v e r s e " ) ; 
 
                         b r e a k ; 
 
                 c a s e   2 0 0 : 
 
                         g r o u p . t y p e   =   0 ; 
 
                         w i n d o w . S e t P r o p e r t y ( " S Y S T E M . g r o u p . t y p e " ,   g r o u p . t y p e ) ; 
 
                         g r o u p . k e y   =   g r o u p _ p a t t e r n _ a l b u m ; 
 
                         w i n d o w . S e t P r o p e r t y ( " S Y S T E M . g r o u p   K e y " ,   g r o u p . k e y ) ; 
 
                         t f _ g r o u p _ k e y   =   f b . T i t l e F o r m a t ( g r o u p . k e y ) ; 
 
                         / / 
 
                         r e d r a w _ s t u b _ i m a g e s ( ) ; 
 
                         g _ i m a g e _ c a c h e   =   n e w   i m a g e _ c a c h e ; 
 
                         C o l l e c t G a r b a g e ( ) ; 
 
                         p l m a n . S o r t B y F o r m a t ( p l m a n . A c t i v e P l a y l i s t ,   " % a l b u m   a r t i s t %   |   % d a t e %   |   % a l b u m %   |   % d i s c n u m b e r %   |   % t r a c k n u m b e r %   |   % t i t l e % " ,   f a l s e ) ; 
 
                         b r e a k ; 
 
                 c a s e   2 0 1 : 
 
                         g r o u p . t y p e   =   1 ; 
 
                         w i n d o w . S e t P r o p e r t y ( " S Y S T E M . g r o u p . t y p e " ,   g r o u p . t y p e ) ; 
 
                         g r o u p . k e y   =   g r o u p _ p a t t e r n _ a r t i s t ; 
 
                         w i n d o w . S e t P r o p e r t y ( " S Y S T E M . g r o u p   K e y " ,   g r o u p . k e y ) ; 
 
                         t f _ g r o u p _ k e y   =   f b . T i t l e F o r m a t ( g r o u p . k e y ) ; 
 
                         / / 
 
                         r e d r a w _ s t u b _ i m a g e s ( ) ; 
 
                         g _ i m a g e _ c a c h e   =   n e w   i m a g e _ c a c h e ; 
 
                         C o l l e c t G a r b a g e ( ) ; 
 
                         p l m a n . S o r t B y F o r m a t ( p l m a n . A c t i v e P l a y l i s t ,   " % a r t i s t %   |   % d a t e %   |   % a l b u m %   |   % d i s c n u m b e r %   |   % t r a c k n u m b e r %   |   % t i t l e % " ,   f a l s e ) ; 
 
                         b r e a k ; 
 
                 c a s e   2 0 2 : 
 
                         g r o u p . t y p e   =   2 ; 
 
                         w i n d o w . S e t P r o p e r t y ( " S Y S T E M . g r o u p . t y p e " ,   g r o u p . t y p e ) ; 
 
                         g r o u p . k e y   =   g r o u p _ p a t t e r n _ p a t h ; 
 
                         w i n d o w . S e t P r o p e r t y ( " S Y S T E M . g r o u p   K e y " ,   g r o u p . k e y ) ; 
 
                         t f _ g r o u p _ k e y   =   f b . T i t l e F o r m a t ( g r o u p . k e y ) ; 
 
                         / / 
 
                         r e d r a w _ s t u b _ i m a g e s ( ) ; 
 
                         g _ i m a g e _ c a c h e   =   n e w   i m a g e _ c a c h e ; 
 
                         C o l l e c t G a r b a g e ( ) ; 
 
                         p l m a n . S o r t B y F o r m a t ( p l m a n . A c t i v e P l a y l i s t ,   " % p a t h % " ,   f a l s e ) ; 
 
                         b r e a k ; 
 
                 d e f a u l t : 
 
 
 
         } ; 
 
         _ s o r t . D i s p o s e ( ) ; 
 
         _ g r o u p b y . D i s p o s e ( ) ; 
 
         _ m e n u . D i s p o s e ( ) ; 
 
         g _ m e n u _ d i s p l a y e d   =   f a l s e ; 
 
         / /   c o l l a p s e   t o o l b a r 
 
         i f ( ! t o o l b a r . l o c k )   { 
 
                 i f ( t o o l b a r . d e l t a = = 0 )   { 
 
                         t o o l b a r . t i m e r I D _ o n   & &   w i n d o w . C l e a r T i m e o u t ( t o o l b a r . t i m e r I D _ o n ) ; 
 
                         t o o l b a r . t i m e r I D _ o n   =   f a l s e ; 
 
                 } ; 
 
                 i f ( t o o l b a r . s t a t e )   { 
 
                         i f ( ! t o o l b a r . t i m e r I D _ o f f )   { 
 
                                 i f ( t o o l b a r . d e l t a   = =   t o o l b a r . c o l l a p s e d _ y * - 1 )   { 
 
                                         t o o l b a r . t i m e r I D _ o f f   =   w i n d o w . S e t T i m e o u t ( f u n c t i o n ( )   { 
 
                                                 i f ( ! t o o l b a r . t i m e r I D 2 )   { 
 
                                                         t o o l b a r . t i m e r I D 2   =   w i n d o w . S e t I n t e r v a l ( f u n c t i o n ( )   { 
 
                                                                 t o o l b a r . d e l t a   - =   t o o l b a r . s t e p ; 
 
                                                                 i f ( t o o l b a r . d e l t a   < =   0 )   { 
 
                                                                         t o o l b a r . d e l t a   =   0 ; 
 
                                                                         t o o l b a r . s t a t e   =   f a l s e ; 
 
                                                                         w i n d o w . C l e a r I n t e r v a l ( t o o l b a r . t i m e r I D 2 ) ; 
 
                                                                         t o o l b a r . t i m e r I D 2   =   f a l s e ; 
 
                                                                 } ; 
 
                                                                 w i n d o w . R e p a i n t R e c t ( 0 ,   0 ,   w w ,   t o o l b a r . c o l l a p s e d _ y * - 1 + 5 ) ; 
 
                                                         } ,   3 0 ) ; 
 
                                                 }   ; 
 
                                                 t o o l b a r . t i m e r I D _ o f f   & &   w i n d o w . C l e a r T i m e o u t ( t o o l b a r . t i m e r I D _ o f f ) ; 
 
                                                 t o o l b a r . t i m e r I D _ o f f   =   f a l s e ; 
 
                                         } ,   4 0 0 ) ; 
 
                                 } ; 
 
                         } ;       
 
                 } ; 
 
         } ; 
 
         r e t u r n   t r u e ; 
 
 } ; 
 
 
 
 f u n c t i o n   s e t t i n g s _ m e n u ( x ,   y )   { 
 
         v a r   i d x ; 
 
         v a r   _ m e n u   =   w i n d o w . C r e a t e P o p u p M e n u ( ) ; 
 
         v a r   _ c o l u m n s   =   w i n d o w . C r e a t e P o p u p M e n u ( ) ; 
 
         v a r   _ a p p e a r a n c e   =   w i n d o w . C r e a t e P o p u p M e n u ( ) ; 
 
         
 
         _ m e n u . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   1 ,   " L o c k   T o o l b a r " ) ; 
 
         _ m e n u . C h e c k M e n u I t e m ( 1 ,   t o o l b a r . l o c k ? 1 : 0 ) ; 
 
         _ m e n u . A p p e n d M e n u S e p a r a t o r ( ) ; 
 
         
 
         _ a p p e a r a n c e . A p p e n d T o ( _ m e n u ,   M F _ S T R I N G ,   " A p p e a r a n c e " ) ; 
 
         _ a p p e a r a n c e . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   1 0 0 ,   " U s e   T h e m e d   S t y l e " ) ; 
 
         _ a p p e a r a n c e . C h e c k M e n u I t e m ( 1 0 0 ,   p a n e l . t h e m e d ? 1 : 0 ) ; 
 
         _ a p p e a r a n c e . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   1 1 0 ,   " U s e   C u s t o m   C o l o r s " ) ; 
 
         _ a p p e a r a n c e . C h e c k M e n u I t e m ( 1 1 0 ,   p a n e l . c u s t o m _ c o l o r s ? 1 : 0 ) ; 
 
         _ a p p e a r a n c e . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   1 2 0 ,   " N o   G r o u p   H e a d e r " ) ; 
 
         _ a p p e a r a n c e . C h e c k M e n u I t e m ( 1 2 0 ,   p a n e l . n o g r o u p h e a d e r ? 1 : 0 ) ; 
 
         _ a p p e a r a n c e . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   1 3 0 ,   " L i g h t   S h a d o w   B o r d e r   ( s u n k e n   e f f e c t ) " ) ; 
 
         _ a p p e a r a n c e . C h e c k M e n u I t e m ( 1 3 0 ,   p a n e l . s h o w _ s h a d o w _ b o r d e r ? 1 : 0 ) ; 
 
         _ a p p e a r a n c e . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   1 4 0 ,   " S h o w   S c r o l l b a r " ) ; 
 
         _ a p p e a r a n c e . C h e c k M e n u I t e m ( 1 4 0 ,   v s c r o l l b a r . s h o w ? 1 : 0 ) ; 
 
         _ a p p e a r a n c e . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   1 4 1 ,   " S h o w   B l u r " ) ; 
 
         _ a p p e a r a n c e . C h e c k M e n u I t e m ( 1 4 1 ,   p p t . w a l l p a p e r b l u r r e d ? 1 : 0 ) ; 
 
         _ a p p e a r a n c e . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   1 4 2 ,   " S h o w   W a l l p a p e r " ) ; 
 
         _ a p p e a r a n c e . C h e c k M e n u I t e m ( 1 4 2 ,   p p t . s h o w w a l l p a p e r ? 1 : 0 ) ; 
 
         _ a p p e a r a n c e . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   1 4 3 ,   " S h o w   A l b u m A r t " ) ; 
 
         _ a p p e a r a n c e . C h e c k M e n u I t e m ( 1 4 3 ,   p p t . w a l l p a p e r m o d e ? 0 : 1 ) ; 
 
 
 
         _ c o l u m n s . A p p e n d T o ( _ m e n u ,   M F _ S T R I N G ,   " C o l u m n s " ) ; 
 
         _ c o l u m n s . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   2 0 0 ,   " P l a y   I c o n " ) ; 
 
         _ c o l u m n s . C h e c k M e n u I t e m ( 2 0 0 ,   c o l u m n s . p l a y i c o n ? 1 : 0 ) ; 
 
         _ c o l u m n s . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   2 1 0 ,   " T r a c k   N u m b e r " ) ; 
 
         _ c o l u m n s . C h e c k M e n u I t e m ( 2 1 0 ,   c o l u m n s . t r a c k n u m b e r ? 1 : 0 ) ; 
 
         _ c o l u m n s . A p p e n d M e n u S e p a r a t o r ( ) ; 
 
         _ c o l u m n s . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   3 3 0 ,   " T i t l e " ) ; 
 
         _ c o l u m n s . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   3 3 1 ,   " T i t l e   ( S m a r t ) " ) ; 
 
         _ c o l u m n s . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   3 3 2 ,   " T i t l e   /   A r t i s t " ) ; 
 
         _ c o l u m n s . C h e c k M e n u R a d i o I t e m ( 3 3 0 ,   3 3 2 ,   c o l u m n s . t i t l e + 3 3 0 ) ; 
 
         _ c o l u m n s . A p p e n d M e n u S e p a r a t o r ( ) ; 
 
         _ c o l u m n s . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   3 0 0 ,   " P l a y c o u n t " ) ; 
 
         _ c o l u m n s . C h e c k M e n u I t e m ( 3 0 0 ,   c o l u m n s . p l a y c o u n t ? 1 : 0 ) ; 
 
         _ c o l u m n s . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   3 1 0 ,   " R a t i n g " ) ; 
 
         _ c o l u m n s . C h e c k M e n u I t e m ( 3 1 0 ,   c o l u m n s . r a t i n g ? 1 : 0 ) ; 
 
         _ c o l u m n s . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   3 2 0 ,   " L o v e   T r a c k " ) ; 
 
         _ c o l u m n s . C h e c k M e n u I t e m ( 3 2 0 ,   c o l u m n s . m o o d ? 1 : 0 ) ; 
 
         _ c o l u m n s . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   3 4 0 ,   " B i t r a t e " ) ; 
 
         _ c o l u m n s . C h e c k M e n u I t e m ( 3 4 0 ,   c o l u m n s . b i t r a t e ? 1 : 0 ) ; 
 
         
 
         _ m e n u . A p p e n d M e n u S e p a r a t o r ( ) ; 
 
         _ m e n u . A p p e n d M e n u I t e m ( f b . I s P l a y i n g ? M F _ S T R I N G : M F _ G R A Y E D | M F _ D I S A B L E D ,   6 ,   " S h o w   N o w   P l a y i n g " ) ; 
 
         _ m e n u . A p p e n d M e n u I t e m ( p l m a n . I s P l a y b a c k Q u e u e A c t i v e ( ) ? M F _ S T R I N G : M F _ G R A Y E D | M F _ D I S A B L E D ,   7 ,   " S h o w   Q u e u e   P l a y l i s t " ) ; 
 
         _ m e n u . A p p e n d M e n u I t e m ( ( c o v e r . s h o w   & &   l i s t . t o t a l > 0   & &   g r o u p . n b r o w s > 1 ) ? M F _ S T R I N G : M F _ D I S A B L E D | M F _ G R A Y E D ,   8 ,   " R e f r e s h   C o v e r s " ) ; 
 
         _ m e n u . A p p e n d M e n u S e p a r a t o r ( ) ; 
 
         i f ( ! s t a t s . f o o _ p l a y c o u n t )   { 
 
                 _ m e n u . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   1 0 ,   " E n a b l e   P l a y b a c k   S t a t i s t i c s " ) ; 
 
                 _ m e n u . C h e c k M e n u I t e m ( 1 0 ,   s t a t s . e n a b l e d ? 1 : 0 ) ; 
 
                 _ m e n u . A p p e n d M e n u S e p a r a t o r ( ) ; 
 
         } ; 
 
         _ m e n u . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   2 0 ,   " P r o p e r t i e s " ) ; 
 
         _ m e n u . A p p e n d M e n u I t e m ( M F _ S T R I N G ,   2 1 ,   " C o n f i g u r e . . . " ) ; 
 
         i d x   =   _ m e n u . T r a c k P o p u p M e n u ( x ,   y ) ; 
 
         
 
         s w i t c h ( i d x )   { 
 
                 c a s e   1 : 
 
                         t o o l b a r . l o c k   =   ! t o o l b a r . l o c k ; 
 
                         w i n d o w . S e t P r o p e r t y ( " S Y S T E M . t o o l b a r . l o c k " ,   t o o l b a r . l o c k ) ; 
 
                         b r e a k ; 
 
                 c a s e   6 : 
 
                         i f ( p l m a n . A c t i v e P l a y l i s t   ! =   p l m a n . P l a y i n g P l a y l i s t )   { 
 
                                 i f ( l i s t . h a n d l e l i s t )   l i s t . h a n d l e l i s t . D i s p o s e ( ) ; 
 
                                 l i s t . h a n d l e l i s t   =   p l m a n . G e t P l a y l i s t I t e m s ( f b . P l a y i n g P l a y l i s t ) ; 
 
                                 l i s t . t o t a l   =   l i s t . h a n d l e l i s t . C o u n t ; 
 
                                 p l m a n . A c t i v e P l a y l i s t   =   p l m a n . P l a y i n g P l a y l i s t ; 
 
                         }   e l s e   { 
 
                                 S h o w N o w P l a y i n g ( ) ; 
 
                                 w i n d o w . R e p a i n t ( ) ; 
 
                         } ; 
 
                         b r e a k ; 
 
                 c a s e   7 : 
 
                         S h o w P l a y l i s t Q u e u e ( 0 ) ; 
 
                         b r e a k ; 
 
                 c a s e   8 : 
 
                         r e d r a w _ s t u b _ i m a g e s ( ) ; 
 
                         g _ i m a g e _ c a c h e   =   n e w   i m a g e _ c a c h e ; 
 
                         C o l l e c t G a r b a g e ( ) ; 
 
                         r e f r e s h _ p l a y l i s t _ c o n t e n t ( ) ; 
 
                         b r e a k ; 
 
                 c a s e   1 0 : 
 
                         s t a t s . e n a b l e d   =   ! s t a t s . e n a b l e d ; 
 
                         w i n d o w . S e t P r o p e r t y ( " S Y S T E M . s t a t i s t i c s . e n a b l e d " ,   s t a t s . e n a b l e d ) ; 
 
                         b r e a k ; 
 
                 c a s e   2 0 : 
 
                         w i n d o w . S h o w P r o p e r t i e s ( ) ; 
 
                         b r e a k ; 
 
                 c a s e   2 1 : 
 
                         w i n d o w . S h o w C o n f i g u r e ( ) ; 
 
                         b r e a k ; 
 
                 c a s e   1 0 0 : 
 
                         p a n e l . t h e m e d   =   ! p a n e l . t h e m e d ; 
 
                         w i n d o w . S e t P r o p e r t y ( " S Y S T E M . p a n e l . t h e m e d " ,   p a n e l . t h e m e d ) ; 
 
                         i f ( p a n e l . t h e m e d )   { 
 
                                 p a n e l . t h e m e   =   w i n d o w . C r e a t e T h e m e M a n a g e r ( " s c r o l l b a r " ) ; 
 
                         }   e l s e   { 
 
                                 p a n e l . t h e m e   =   f a l s e ; 
 
                         } ; 
 
                         r e c a l c _ d a t a s ( ) ; 
 
                         i n i t _ i c o n s ( ) ; 
 
                         s e t _ s c r o l l e r ( ) ; 
 
                         w i n d o w . R e p a i n t ( ) ; 
 
                         b r e a k ; 
 
                 c a s e   1 1 0 : 
 
                         p a n e l . c u s t o m _ c o l o r s   =   ! p a n e l . c u s t o m _ c o l o r s ; 
 
                         w i n d o w . S e t P r o p e r t y ( " S Y S T E M . p a n e l . c u s t o m . c o l o r s " ,   p a n e l . c u s t o m _ c o l o r s ) ; 
 
                         o n _ c o l o r s _ c h a n g e d ( ) ; 
 
                         b r e a k ; 
 
                 c a s e   1 2 0 : 
 
                         p a n e l . n o g r o u p h e a d e r   =   ! p a n e l . n o g r o u p h e a d e r ; 
 
                         w i n d o w . S e t P r o p e r t y ( " S Y S T E M . n o . g r o u p . h e a d e r " ,   p a n e l . n o g r o u p h e a d e r ) ; 
 
                         r e c a l c _ d a t a s ( ) ; 
 
                         r e d r a w _ s t u b _ i m a g e s ( ) ; 
 
                         r e f r e s h _ p l a y l i s t _ c o n t e n t ( ) ; 
 
                         b r e a k ; 
 
                 c a s e   1 3 0 : 
 
                         p a n e l . s h o w _ s h a d o w _ b o r d e r   =   ! p a n e l . s h o w _ s h a d o w _ b o r d e r ; 
 
                         w i n d o w . S e t P r o p e r t y ( " S Y S T E M . s h a d o w . b o r d e r . e n a b l e d " ,   p a n e l . s h o w _ s h a d o w _ b o r d e r ) ; 
 
                         w i n d o w . R e p a i n t ( ) ; 
 
                         b r e a k ; 
 
                 c a s e   1 4 0 : 
 
                         v s c r o l l b a r . s h o w   =   ! v s c r o l l b a r . s h o w ; 
 
                         w i n d o w . S e t P r o p e r t y ( " S Y S T E M . v s c r o l l b a r . v i s i b l e " ,   v s c r o l l b a r . s h o w ) ; 
 
                         i f ( l i s t . i t e m . l e n g t h > l i s t . n b v i s )   { 
 
                                 i f ( v s c r o l l b a r . s h o w )   { 
 
                                         v s c r o l l b a r . v i s i b l e   =   t r u e ; 
 
                                 }   e l s e   { 
 
                                         v s c r o l l b a r . v i s i b l e   =   f a l s e ; 
 
                                 } ; 
 
                         }   e l s e   { 
 
                                 v s c r o l l b a r . v i s i b l e   =   f a l s e ; 
 
                         } ; 
 
                         r e f r e s h _ p l a y l i s t _ c o n t e n t ( ) ; 
 
                         b r e a k ; 
 
                 c a s e   1 4 1 : 
 
                         p p t . w a l l p a p e r b l u r r e d   =   ! p p t . w a l l p a p e r b l u r r e d ; 
 
                         w i n d o w . S e t P r o p e r t y ( " _ D I S P L A Y :   W a l l p a p e r   B l u r r e d " ,   p p t . w a l l p a p e r b l u r r e d ) ; 
 
                         o n _ s i z e ( ) ; 
 
                         b r e a k ; 
 
                 c a s e   1 4 2 : 
 
                         p p t . s h o w w a l l p a p e r   =   ! p p t . s h o w w a l l p a p e r ; 
 
                         w i n d o w . G e t P r o p e r t y ( " _ D I S P L A Y :   S h o w   W a l l p a p e r " ,   p p t . s h o w w a l l p a p e r ) ; 
 
                         o n _ s i z e ( ) ; 
 
                         b r e a k ; 
 
                 c a s e   1 4 3 : 
 
                         p p t . w a l l p a p e r m o d e   =   ! p p t . w a l l p a p e r m o d e ; 
 
                         w i n d o w . G e t P r o p e r t y ( " _ D I S P L A Y :   W a l l p a p e r   M o d e " ,   p p t . w a l l p a p e r m o d e ) ; 
 
                         o n _ s i z e ( ) ; 
 
                         b r e a k ; 
 
                 c a s e   2 0 0 : 
 
                         c o l u m n s . p l a y i c o n   =   ! c o l u m n s . p l a y i c o n ; 
 
                         w i n d o w . S e t P r o p e r t y ( " S Y S T E M . c o l u m n s . p l a y i c o n . e n a b l e d " ,   c o l u m n s . p l a y i c o n ) ; 
 
                         r e f r e s h _ s p v ( p l m a n . A c t i v e P l a y l i s t ,   t r u e ) ; 
 
                         b r e a k ; 
 
                 c a s e   2 1 0 : 
 
                         c o l u m n s . t r a c k n u m b e r   =   ! c o l u m n s . t r a c k n u m b e r ; 
 
                         w i n d o w . S e t P r o p e r t y ( " S Y S T E M . c o l u m n s . t r a c k n u m b e r . e n a b l e d " ,   c o l u m n s . t r a c k n u m b e r ) ; 
 
                         r e f r e s h _ s p v ( p l m a n . A c t i v e P l a y l i s t ,   t r u e ) ; 
 
                         b r e a k ; 
 
                 c a s e   3 0 0 : 
 
                         c o l u m n s . p l a y c o u n t   =   ! c o l u m n s . p l a y c o u n t ; 
 
                         w i n d o w . S e t P r o p e r t y ( " S Y S T E M . c o l u m n s . p l a y c o u n t . e n a b l e d " ,   c o l u m n s . p l a y c o u n t ) ; 
 
                         r e f r e s h _ s p v ( p l m a n . A c t i v e P l a y l i s t ,   t r u e ) ; 
 
                         b r e a k ; 
 
                 c a s e   3 1 0 : 
 
                         c o l u m n s . d u r a t i o n _ w   =   0 ; 
 
                         c o l u m n s . b i t r a t e _ w   =   0 ; 
 
                         c o l u m n s . r a t i n g   =   ! c o l u m n s . r a t i n g ; 
 
                         w i n d o w . S e t P r o p e r t y ( " S Y S T E M . c o l u m n s . r a t i n g . e n a b l e d " ,   c o l u m n s . r a t i n g ) ; 
 
                         r e f r e s h _ s p v ( p l m a n . A c t i v e P l a y l i s t ,   t r u e ) ; 
 
                         b r e a k ; 
 
                 c a s e   3 2 0 : 
 
                         c o l u m n s . d u r a t i o n _ w   =   0 ; 
 
                         c o l u m n s . b i t r a t e _ w   =   0 ; 
 
                         c o l u m n s . m o o d   =   ! c o l u m n s . m o o d ; 
 
                         w i n d o w . S e t P r o p e r t y ( " S Y S T E M . c o l u m n s . m o o d . e n a b l e d " ,   c o l u m n s . m o o d ) ; 
 
                         r e f r e s h _ s p v ( p l m a n . A c t i v e P l a y l i s t ,   t r u e ) ; 
 
                         b r e a k ; 
 
                 c a s e   3 4 0 : 
 
                         c o l u m n s . d u r a t i o n _ w   =   0 ; 
 
                         c o l u m n s . b i t r a t e _ w   =   0 ; 
 
                         c o l u m n s . b i t r a t e   =   ! c o l u m n s . b i t r a t e ; 
 
                         w i n d o w . S e t P r o p e r t y ( " S Y S T E M . c o l u m n s . b i t r a t e . e n a b l e d " ,   c o l u m n s . b i t r a t e ) ; 
 
                         r e f r e s h _ s p v ( p l m a n . A c t i v e P l a y l i s t ,   t r u e ) ; 
 
                         b r e a k ; 
 
                 c a s e   3 3 0 : 
 
                 c a s e   3 3 1 : 
 
                 c a s e   3 3 2 : 
 
                         c o l u m n s . t i t l e   =   i d x   -   3 3 0 ; 
 
                         w i n d o w . S e t P r o p e r t y ( " S Y S T E M . c o l u m n s . t i t l e . p a t t e r n " ,   c o l u m n s . t i t l e ) ; 
 
                         w i n d o w . R e p a i n t ( ) ; 
 
                         b r e a k ; 
 
                 d e f a u l t : 
 
 
 
         } ; 
 
         _ a p p e a r a n c e . D i s p o s e ( ) ; 
 
         _ c o l u m n s . D i s p o s e ( ) ; 
 
         _ m e n u . D i s p o s e ( ) ; 
 
         g _ m e n u _ d i s p l a y e d   =   f a l s e ; 
 
         / /   c o l l a p s e   t o o l b a r 
 
         i f ( ! t o o l b a r . l o c k )   { 
 
                 i f ( t o o l b a r . d e l t a = = 0 )   { 
 
                         t o o l b a r . t i m e r I D _ o n   & &   w i n d o w . C l e a r T i m e o u t ( t o o l b a r . t i m e r I D _ o n ) ; 
 
                         t o o l b a r . t i m e r I D _ o n   =   f a l s e ; 
 
                 } ; 
 
                 i f ( t o o l b a r . s t a t e )   { 
 
                         i f ( ! t o o l b a r . t i m e r I D _ o f f )   { 
 
                                 i f ( t o o l b a r . d e l t a   = =   t o o l b a r . c o l l a p s e d _ y * - 1 )   { 
 
                                         t o o l b a r . t i m e r I D _ o f f   =   w i n d o w . S e t T i m e o u t ( f u n c t i o n ( )   { 
 
                                                 i f ( ! t o o l b a r . t i m e r I D 2 )   { 
 
                                                         t o o l b a r . t i m e r I D 2   =   w i n d o w . S e t I n t e r v a l ( f u n c t i o n ( )   { 
 
                                                                 t o o l b a r . d e l t a   - =   t o o l b a r . s t e p ; 
 
                                                                 i f ( t o o l b a r . d e l t a   < =   0 )   { 
 
                                                                         t o o l b a r . d e l t a   =   0 ; 
 
                                                                         t o o l b a r . s t a t e   =   f a l s e ; 
 
                                                                         w i n d o w . C l e a r I n t e r v a l ( t o o l b a r . t i m e r I D 2 ) ; 
 
                                                                         t o o l b a r . t i m e r I D 2   =   f a l s e ; 
 
                                                                 } ; 
 
                                                                 w i n d o w . R e p a i n t R e c t ( 0 ,   0 ,   w w ,   t o o l b a r . c o l l a p s e d _ y * - 1 + 5 ) ; 
 
                                                         } ,   3 0 ) ; 
 
                                                 }   ; 
 
                                                 t o o l b a r . t i m e r I D _ o f f   & &   w i n d o w . C l e a r T i m e o u t ( t o o l b a r . t i m e r I D _ o f f ) ; 
 
                                                 t o o l b a r . t i m e r I D _ o f f   =   f a l s e ; 
 
                                         } ,   4 0 0 ) ; 
 
                                 } ; 
 
                         } ;       
 
                 } ; 
 
         } ; 
 
         r e t u r n   t r u e ; 
 
 } ; 
 
 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = / /   D r a g ' n ' D r o p   C a l l b a c k s 
 
 v a r   w s h _ d r a g g i n g   =   f a l s e ; 
 
 
 
 f u n c t i o n   o n _ d r a g _ e n t e r ( )   { 
 
         w s h _ d r a g g i n g   =   t r u e ; 
 
 } ; 
 
 
 
 f u n c t i o n   o n _ d r a g _ l e a v e ( )   { 
 
         w s h _ d r a g g i n g   =   f a l s e ; 
 
 } ; 
 
 
 
 f u n c t i o n   o n _ d r a g _ o v e r ( a c t i o n ,   x ,   y ,   m a s k )   { 
 
         o n _ m o u s e _ m o v e ( x ,   y ) ; 
 
 } ; 
 
 
 
 f u n c t i o n   o n _ d r a g _ d r o p ( a c t i o n ,   x ,   y ,   m a s k )   { 
 
         w s h _ d r a g g i n g   =   f a l s e ; 
 
         / /   W e   a r e   g o i n g   t o   p r o c e s s   t h e   d r o p p e d   i t e m s   t o   a   p l a y l i s t 
 
         a c t i o n . T o P l a y l i s t ( ) ; 
 
         a c t i o n . P l a y l i s t   =   p l m a n . A c t i v e P l a y l i s t ; 
 
         a c t i o n . T o S e l e c t   =   f a l s e ; 
 
 } ; 
 
 
 
 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = / /   Q u e u e   P l a y l i s t   f e a t u r e s 
 
 
 
 f u n c t i o n   o n _ p l a y b a c k _ q u e u e _ c h a n g e d ( o r i g i n )   { 
 
         i f ( i s Q u e u e P l a y l i s t A c t i v e ( ) )   { 
 
                 S h o w P l a y l i s t Q u e u e ( 0 ) ; 
 
         }   e l s e   { 
 
                 S e t P l a y l i s t Q u e u e ( ) ; 
 
         } ; 
 
 } ; 
 
 
 
 f u n c t i o n   i s Q u e u e P l a y l i s t A c t i v e ( )   { 
 
         v a r   q u e u e _ p l _ i d x   =   i s Q u e u e P l a y l i s t P r e s e n t ( ) ; 
 
         i f ( q u e u e _ p l _ i d x < 0 )   { 
 
                 r e t u r n   f a l s e ; 
 
         }   e l s e   i f ( p l m a n . A c t i v e P l a y l i s t   = =   q u e u e _ p l _ i d x )   { 
 
                 r e t u r n   t r u e ; 
 
         } ; 
 
 } ; 
 
 
 
 f u n c t i o n   i s Q u e u e P l a y l i s t P r e s e n t ( )   { 
 
         f o r ( v a r   i = 0 ;   i < p l m a n . P l a y l i s t C o u n t ;   i + + )   { 
 
                 i f ( p l m a n . G e t P l a y l i s t N a m e ( i ) = = " Q u e u e   C o n t e n t " )   r e t u r n   i ; 
 
         } ; 
 
         r e t u r n   - 1 ;         
 
 } ; 
 
 
 
 f u n c t i o n   S e t P l a y l i s t Q u e u e ( )   { 
 
         v a r   t o t a l _ p l   =   p l m a n . P l a y l i s t C o u n t ; 
 
         v a r   q u e u e _ p l _ i d x   =   i s Q u e u e P l a y l i s t P r e s e n t ( ) ; 
 
         i f ( q u e u e _ p l _ i d x < 0 )   { 
 
                 r e t u r n   t r u e ; 
 
         }   e l s e   { 
 
                 v a r   t o t a l _ i n _ p l s   =   p l m a n . P l a y l i s t I t e m C o u n t ( q u e u e _ p l _ i d x ) ; 
 
                 i f ( t o t a l _ i n _ p l s   >   0 )   { 
 
                         v a r   a f f e c t e d _ i t e m s   =   A r r a y ( ) ; 
 
                         f o r ( v a r   i = 0 ;   i < t o t a l _ i n _ p l s ;   i + + )   { 
 
                                 a f f e c t e d _ i t e m s . p u s h ( i ) ; 
 
                         } ; 
 
                         p l m a n . S e t P l a y l i s t S e l e c t i o n ( q u e u e _ p l _ i d x ,   a f f e c t e d _ i t e m s ,   t r u e ) ; 
 
                         p l m a n . R e m o v e P l a y l i s t S e l e c t i o n ( q u e u e _ p l _ i d x ) ; 
 
                 } ; 
 
         } ; 
 
         v a r   q u e u e _ t o t a l   =   p l m a n . G e t P l a y b a c k Q u e u e C o u n t ( ) ; 
 
         v a r   v b a r r   =   p l m a n . G e t P l a y b a c k Q u e u e C o n t e n t s ( ) ; 
 
         v a r   a r r   =   v b a r r . t o A r r a y ( ) ; 
 
         v a r   q _ h a n d l e l i s t   =   p l m a n . G e t P l a y l i s t S e l e c t e d I t e m s ( q u e u e _ p l _ i d x ) ; 
 
         q _ h a n d l e l i s t . R e m o v e A l l ( ) ; 
 
         f o r ( v a r   j = 0 ;   j < q u e u e _ t o t a l ;   j + + )   { 
 
                 q _ h a n d l e l i s t . A d d ( a r r [ j ] . H a n d l e ) ; 
 
         } ; 
 
         p l m a n . I n s e r t P l a y l i s t I t e m s ( q u e u e _ p l _ i d x ,   j ,   q _ h a n d l e l i s t ,   f a l s e ) ; 
 
 } ; 
 
 
 
 f u n c t i o n   S h o w P l a y l i s t Q u e u e ( f o c u s _ i d )   { 
 
         v a r   t o t a l _ p l   =   p l m a n . P l a y l i s t C o u n t ; 
 
         v a r   q u e u e _ p l _ i d x   =   i s Q u e u e P l a y l i s t P r e s e n t ( ) ; 
 
         i f ( q u e u e _ p l _ i d x < 0 )   { 
 
                 p l m a n . C r e a t e P l a y l i s t ( t o t a l _ p l ,   " Q u e u e   C o n t e n t " ) ; 
 
                 q u e u e _ p l _ i d x   =   t o t a l _ p l ; 
 
                 p l m a n . A c t i v e P l a y l i s t   =   q u e u e _ p l _ i d x ; 
 
         }   e l s e   { 
 
                 p l m a n . A c t i v e P l a y l i s t   =   q u e u e _ p l _ i d x ; 
 
                 f b . C l e a r P l a y l i s t ( ) ; 
 
         } ; 
 
         v a r   q u e u e _ t o t a l   =   p l m a n . G e t P l a y b a c k Q u e u e C o u n t ( ) ; 
 
         v a r   v b a r r   =   p l m a n . G e t P l a y b a c k Q u e u e C o n t e n t s ( ) ; 
 
         v a r   a r r   =   v b a r r . t o A r r a y ( ) ; 
 
         v a r   q _ h a n d l e l i s t   =   p l m a n . G e t P l a y l i s t S e l e c t e d I t e m s ( q u e u e _ p l _ i d x ) ; 
 
         q _ h a n d l e l i s t . R e m o v e A l l ( ) ; 
 
         f o r ( v a r   i = 0 ;   i < q u e u e _ t o t a l ;   i + + )   { 
 
                 q _ h a n d l e l i s t . A d d ( a r r [ i ] . H a n d l e ) ; 
 
         } ; 
 
         p l m a n . I n s e r t P l a y l i s t I t e m s ( q u e u e _ p l _ i d x ,   i ,   q _ h a n d l e l i s t ,   f a l s e ) ; 
 
         p l m a n . S e t P l a y l i s t F o c u s I t e m ( q u e u e _ p l _ i d x ,   f o c u s _ i d ) ; 
 
 } ;         
 
         / / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *   W a l l p a p e r   * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / / 
 
         / / * * * * * * * * * * * * * * * * * * * * * * * * * * * *   A l b u m   A r t   V i e w   * * * * * * * * * * * * * * * * * * * * * * * * * * / / 
 
         / / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *   c o d e d   b y   * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / / 
 
         / / * * * * * * * * * * * * * * * * * * * * * * * * * *   B r 3 t t   a k a   F a l s t a f f   * * * * * * * * * * * * * * * * * * * * * * * * / / 
 
         / / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / / 
 
 f u n c t i o n   s e t W a l l p a p e r I m g ( p a t h ,   m e t a d b )   { 
 
         p r o g r e s s   =   0 ; 
 
         g _ s e c o n d s   =   0 ; 
 
         v a r   f m t _ p a t h   =   f b . T i t l e F o r m a t ( p a t h ) . E v a l ( t r u e ) ; 
 
         v a r   f m t _ p a t h _ a r r   =   u t i l s . G l o b ( f m t _ p a t h ) . t o A r r a y ( ) ; 
 
         i f ( f m t _ p a t h _ a r r . l e n g t h   >   0 )   { 
 
                 v a r   f i n a l _ p a t h   =   f m t _ p a t h _ a r r [ 0 ] ; 
 
         } ;   e l s e   { 
 
                 v a r   f i n a l _ p a t h   =   n u l l ; 
 
         } ; 
 
         
 
         i f ( m e t a d b   & &   p p t . w a l l p a p e r m o d e   = =   0 )   { 
 
                 v a r   t m p _ i m g   =   u t i l s . G e t A l b u m A r t V 2 ( m e t a d b ,   p p t . w a l l p a p e r m o d e ) ; 
 
         } ;   e l s e   { 
 
                 i f ( f i n a l _ p a t h )   { 
 
                         t m p _ i m g   =   g d i . I m a g e ( f i n a l _ p a t h ) ; 
 
                 } ;   e l s e   { 
 
                         t m p _ i m g   =   n u l l ; 
 
                 } ; 
 
         } ; 
 
         i f ( ! t m p _ i m g )   { 
 
                 i f ( f i n a l _ p a t h )   { 
 
                         t m p _ i m g   =   g d i . I m a g e ( f i n a l _ p a t h ) ; 
 
                 } ;   e l s e   { 
 
                         t m p _ i m g   =   n u l l ; 
 
                 } ; 
 
         } ; 
 
 
 
         g _ w a l l p a p e r I m g   =   n u l l ; 
 
         v a r   i m g   =   F o r m a t W a l l p a p e r ( t m p _ i m g ,   w w ,   w h ,   2 ,   0 ,   0 ,   " " ,   t r u e ) ; 
 
         r e t u r n   i m g ; 
 
 } ; 
 
 
 
 f u n c t i o n   d r a w _ b l u r r e d _ i m a g e ( i m a g e , i x , i y , i w , i h , b x , b y , b w , b h , b l u r _ v a l u e , o v e r l a y _ c o l o r )   { 
 
         v a r   b l u r V a l u e   =   b l u r _ v a l u e ; 
 
         v a r   i m g A   =   i m a g e . R e s i z e ( i w * b l u r V a l u e / 1 0 0 , i h * b l u r V a l u e / 1 0 0 , 2 ) ; 
 
         v a r   i m g B   =   i m g A . r e s i z e ( i w ,   i h ,   2 ) ; 
 
         v a r   o v e r l a y _ c o l o r   =   R G B A ( 0 , 0 , 0 , p p t . w a l l p a p e r o v e r l a y a l p h a ) ; / / 5 0 ) ; 
 
         
 
         v a r   b b o x   =   g d i . C r e a t e I m a g e ( b w ,   b h ) ; 
 
         / /   G e t   g r a p h i c s   i n t e r f a c e   l i k e   " g r "   i n   o n _ p a i n t 
 
         v a r   g b   =   b b o x . G e t G r a p h i c s ( ) ; 
 
         v a r   o f f s e t   =   9 0 - b l u r V a l u e ; 
 
         g b . D r a w I m a g e ( i m g B ,   0 - o f f s e t ,   0 - ( i h - b h ) - o f f s e t ,   i w + o f f s e t * 2 ,   i h + o f f s e t * 2 ,   0 ,   0 ,   i m g B . W i d t h ,   i m g B . H e i g h t ,   0 ,   2 5 5 ) ; 
 
         b b o x . R e l e a s e G r a p h i c s ( g b ) ; 
 
 
 
         v a r   n e w I m g   =   g d i . C r e a t e I m a g e ( i w ,   i h ) ; 
 
         v a r   g b   =   n e w I m g . G e t G r a p h i c s ( ) ; 
 
 
 
         i f ( i x ! = b x   | |   i y ! = b y   | |   i w ! = b w   | |   i h ! = b h )   { 
 
                 g b . D r a w I m a g e ( i m a g e ,   i x ,   i y ,   i w ,   i h ,   0 ,   0 ,   i m a g e . W i d t h ,   i m a g e . H e i g h t ,   0 ,   2 5 5 ) ; 
 
                 g b . F i l l S o l i d R e c t ( b x , b y , b w , b h , 0 x f f f f f f f f ) ; 
 
         } ; 
 
         g b . D r a w I m a g e ( b b o x ,   b x ,   b y ,   b w ,   b h ,   0 ,   0 ,   b b o x . W i d t h ,   b b o x . H e i g h t ,   0 ,   2 5 5 ) ; 
 
         
 
         / /   o v e r l a y 
 
         i f ( o v e r l a y _ c o l o r ! = n u l l )   { 
 
                 g b . F i l l S o l i d R e c t ( b x , b y , b w , b h , o v e r l a y _ c o l o r ) ; 
 
         } ; 
 
         
 
         / /   t o p   b o r d e r   o f   b l u r   a r e a 
 
         i f ( i x ! = b x   | |   i y ! = b y   | |   i w ! = b w   | |   i h ! = b h )   { 
 
                 g b . F i l l S o l i d R e c t ( b x , b y , b w , 1 , 0 x 2 2 f f f f f f ) ; 
 
                 g b . F i l l S o l i d R e c t ( b x , b y - 1 , b w , 1 , 0 x 2 2 0 0 0 0 0 0 ) ; 
 
         } ; 
 
         n e w I m g . R e l e a s e G r a p h i c s ( g b ) ; 
 
         
 
         r e t u r n   n e w I m g ; 
 
 } ; 
 
 
 
 f u n c t i o n   F o r m a t W a l l p a p e r ( i m a g e ,   i w ,   i h ,   i n t e r p o l a t i o n _ m o d e ,   d i s p l a y _ m o d e ,   a n g l e ,   t x t ,   r a w B i t m a p )   { 
 
         i f ( ! i m a g e | | ! i w | | ! i h )   r e t u r n   i m a g e ; 
 
         v a r   i ,   j ; 
 
 
 
         v a r   p a n e l _ r a t i o   =   i w   /   i h ; 
 
         w p p _ i m g _ i n f o . r a t i o   =   i m a g e . W i d t h   /   i m a g e . H e i g h t ; 
 
         w p p _ i m g _ i n f o . o r i e n t   =   0 ; 
 
 
 
         i f ( w p p _ i m g _ i n f o . r a t i o   >   p a n e l _ r a t i o )   { 
 
                 w p p _ i m g _ i n f o . o r i e n t   =   1 ; 
 
                 / /   1 / 3   :   d e f a u l t   i m a g e   i s   i n   l a n d s c a p e   m o d e         
 
                 s w i t c h ( d i s p l a y _ m o d e )   { 
 
                         c a s e   0 :           / /   F i l l i n g 
 
                                 / / w p p _ i m g _ i n f o . w   =   i w   *   w p p _ i m g _ i n f o . r a t i o   /   p a n e l _ r a t i o ; 
 
                                 w p p _ i m g _ i n f o . w   =   i h   *   w p p _ i m g _ i n f o . r a t i o ; 
 
                                 w p p _ i m g _ i n f o . h   =   i h ; 
 
                                 w p p _ i m g _ i n f o . c u t   =   w p p _ i m g _ i n f o . w   -   i w ; 
 
                                 w p p _ i m g _ i n f o . x   =   0   -   ( w p p _ i m g _ i n f o . c u t   /   2 ) ; 
 
                                 w p p _ i m g _ i n f o . y   =   0 ; 
 
                                 b r e a k ; 
 
                         c a s e   1 :           / /   A d j u s t 
 
                                 w p p _ i m g _ i n f o . w   =   i w ; 
 
                                 w p p _ i m g _ i n f o . h   =   i h   /   w p p _ i m g _ i n f o . r a t i o   *   p a n e l _ r a t i o ; 
 
                                 w p p _ i m g _ i n f o . c u t   =   i h   -   w p p _ i m g _ i n f o . h ; 
 
                                 w p p _ i m g _ i n f o . x   =   0 ; 
 
                                 w p p _ i m g _ i n f o . y   =   w p p _ i m g _ i n f o . c u t   /   2 ; 
 
                                 b r e a k ; 
 
                         c a s e   2 :           / /   S t r e t c h 
 
                                 w p p _ i m g _ i n f o . w   =   i w ; 
 
                                 w p p _ i m g _ i n f o . h   =   i h ; 
 
                                 w p p _ i m g _ i n f o . c u t   =   0 ; 
 
                                 w p p _ i m g _ i n f o . x   =   0 ; 
 
                                 w p p _ i m g _ i n f o . y   =   0 ; 
 
                                 b r e a k ; 
 
                 } ; 
 
         } ;   e l s e   i f ( w p p _ i m g _ i n f o . r a t i o   <   p a n e l _ r a t i o )   { 
 
                 w p p _ i m g _ i n f o . o r i e n t   =   2 ; 
 
                 / /   2 / 3   :   d e f a u l t   i m a g e   i s   i n   p o r t r a i t   m o d e 
 
                 s w i t c h ( d i s p l a y _ m o d e )   { 
 
                         c a s e   0 :           / /   F i l l i n g 
 
                                 w p p _ i m g _ i n f o . w   =   i w ; 
 
                                 / / w p p _ i m g _ i n f o . h   =   i h   /   w p p _ i m g _ i n f o . r a t i o   *   p a n e l _ r a t i o ; 
 
                                 w p p _ i m g _ i n f o . h   =   i w   /   w p p _ i m g _ i n f o . r a t i o ; 
 
                                 w p p _ i m g _ i n f o . c u t   =   w p p _ i m g _ i n f o . h   -   i h ; 
 
                                 w p p _ i m g _ i n f o . x   =   0 ; 
 
                                 w p p _ i m g _ i n f o . y   =   0   -   ( w p p _ i m g _ i n f o . c u t   /   4 ) ; 
 
                                 b r e a k ; 
 
                         c a s e   1 :           / /   A d j u s t 
 
                                 w p p _ i m g _ i n f o . h   =   i h ; 
 
                                 w p p _ i m g _ i n f o . w   =   i w   *   w p p _ i m g _ i n f o . r a t i o   /   p a n e l _ r a t i o ; 
 
                                 w p p _ i m g _ i n f o . c u t   =   i w   -   w p p _ i m g _ i n f o . w ; 
 
                                 w p p _ i m g _ i n f o . y   =   0 ; 
 
                                 w p p _ i m g _ i n f o . x   =   w p p _ i m g _ i n f o . c u t   /   2 ; 
 
                                 b r e a k ; 
 
                         c a s e   2 :           / /   S t r e t c h 
 
                                 w p p _ i m g _ i n f o . w   =   i w ; 
 
                                 w p p _ i m g _ i n f o . h   =   i h ; 
 
                                 w p p _ i m g _ i n f o . c u t   =   0 ; 
 
                                 w p p _ i m g _ i n f o . x   =   0 ; 
 
                                 w p p _ i m g _ i n f o . y   =   0 ; 
 
                                 b r e a k ; 
 
                 } ; 
 
         } ;   e l s e   { 
 
                 / /   3 / 3   :   d e f a u l t   i m a g e   i s   a   s q u a r e   p i c t u r e ,   r a t i o   =   1 
 
                 w p p _ i m g _ i n f o . w   =   i w ; 
 
                 w p p _ i m g _ i n f o . h   =   i h ; 
 
                 w p p _ i m g _ i n f o . c u t   =   0 ; 
 
                 w p p _ i m g _ i n f o . x   =   0 ; 
 
                 w p p _ i m g _ i n f o . y   =   0 ; 
 
         } ; 
 
 
 
         v a r   t m p _ i m g   =   g d i . C r e a t e I m a g e ( i w ,   i h ) ; 
 
         v a r   g p   =   t m p _ i m g . G e t G r a p h i c s ( ) ; 
 
         g p . S e t I n t e r p o l a t i o n M o d e ( i n t e r p o l a t i o n _ m o d e ) ; 
 
         g p . D r a w I m a g e ( i m a g e ,   w p p _ i m g _ i n f o . x ,   w p p _ i m g _ i n f o . y ,   w p p _ i m g _ i n f o . w ,   w p p _ i m g _ i n f o . h ,   0 ,   0 ,   i m a g e . W i d t h ,   i m a g e . H e i g h t ,   a n g l e ,   p p t . w a l l p a p e r a l p h a ) ; / / 2 5 5 ) ; 
 
         t m p _ i m g . R e l e a s e G r a p h i c s ( g p ) ; 
 
         
 
         / /   b l u r   i t ! 
 
         i f ( p p t . w a l l p a p e r b l u r r e d )   { 
 
                 v a r   b l u r _ f a c t o r   =   p p t . w a l l p a p e r b l u r v a l u e ;   / /   [ 1 - 9 0 ] 
 
                 t m p _ i m g   =   d r a w _ b l u r r e d _ i m a g e ( t m p _ i m g , 0 , 0 , t m p _ i m g . W i d t h , t m p _ i m g . H e i g h t , 0 , 0 , t m p _ i m g . W i d t h , t m p _ i m g . H e i g h t , b l u r _ f a c t o r , 0 x 0 0 f f f f f f ) ; 
 
         } ; 
 
         
 
         C o l l e c t G a r b a g e ( ) ; 
 
         i f ( r a w B i t m a p )   { 
 
                 r e t u r n   t m p _ i m g . C r e a t e R a w B i t m a p ( ) ; 
 
         } ;   e l s e   { 
 
                 r e t u r n   t m p _ i m g ; 
 
         } ; 
 
 } ; 
 
 
 
 f u n c t i o n   o n _ p l a y b a c k _ n e w _ t r a c k ( m e t a d b )   { 
 
         p r o g r e s s   =   0 ; 
 
         g _ m e t a d b   =   m e t a d b ; 
 
         i f ( p p t . s h o w w a l l p a p e r )   { 
 
                 g _ w a l l p a p e r I m g   =   s e t W a l l p a p e r I m g ( p p t . w a l l p a p e r p a t h ,   m e t a d b ) ; 
 
         } ; 
 
                 w i n d o w . R e p a i n t ( ) ; 
 
 } ; 